steps to optimize the query on explain plan

Hello

Please find the described explain the plan of a query, and suggest me where and how can grant us the request.

{code}

-----------------------------------------------------------------------------------------------------------------------

| ID | Operation | Name                        | Lines | Bytes | TempSpc | Cost (% CPU). Time |

-----------------------------------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |                             |   352K |    60 M |       | 17677 (12) | 00:03:33 |

|   1.  TRANSFORMATION OF THE TEMPORARY TABLE.                             |       |       |       |            |          |

|   2.   LOAD SELECT ACE | SYS_TEMP_0FD9FCB72_F58FAD20 |       |       |       |            |          |

|   3.    VIEW                         |                             |    22G |  3684G |       |    96 M (100) | 320:57:19 |

|   4.     UNIQUE FATE |                             |    22G |  4837G |   436G |    96 M (1) | 320:57:19 |

|   5.      CONCATENATION.                             |       |       |       |            |          |

|*  6 |       HASH JOIN |                             |  1792M |   392G |       | 52682 (26) | 00:10:33 |

|   7.        VIEW                     | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

|*  8 |         MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

|*  9 |        HASH JOIN |                             |  1792M |   372G |  9320K | 43943 (16) | 00:08:48 |

|  10.         VIEW                    | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  11.          MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 12 |         EXTERNAL RIGHT HASH JOIN |                             |   676K |   128 M |    19 M | 29255 (1) | 00:05:52 |

|  13.          VIEW                   | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 14 |           TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 15 |          HASH JOIN |                             |   195K |    34 M |  9240K | 24001 (1) | 00:04:49 |

|  16.           VIEW                  | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  17.            MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| * 18.           OUTER HASH JOIN |                             |   114K |    17 M |    12 M | 21748 (1) | 00:04:21 |

| * 19.            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  20.            VIEW                 | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 21.             TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 22.       HASH JOIN |                             |    89 M |    19G |       | 46498 (16) | 00:09:18 |

|  23.        VIEW                     | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 24.         MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 25.        HASH JOIN |                             |    89 M |    18G |  9320K | 43943 (16) | 00:08:48 |

|  26.         VIEW                    | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  27.          MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 28.         EXTERNAL RIGHT HASH JOIN |                             |   676K |   128 M |    19 M | 29255 (1) | 00:05:52 |

|  29.          VIEW                   | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 30 |           TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 31.          HASH JOIN |                             |   195K |    34 M |  9240K | 24001 (1) | 00:04:49 |

|  32.           VIEW                  | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  33.            MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| * 34 |           OUTER HASH JOIN |                             |   114K |    17 M |    12 M | 21748 (1) | 00:04:21 |

| * 35 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  36.            VIEW                 | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 37 |             TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 38 |       HASH JOIN |                             |  4480K |  1004M |       | 46189 (15) | 00:09:15 |

|  39.        VIEW                     | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 40 |         MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 41.        HASH JOIN |                             |  4480K |   952 M |  9320K | 43943 (16) | 00:08:48 |

|  42.         VIEW                    | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  43.          MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 44 |         EXTERNAL RIGHT HASH JOIN |                             |   676K |   128 M |    19 M | 29255 (1) | 00:05:52 |

|  45.          VIEW                   | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 46 |           TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 47 |          HASH JOIN |                             |   195K |    34 M |  9240K | 24001 (1) | 00:04:49 |

|  48.           VIEW                  | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  49.            MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| * 50 |           OUTER HASH JOIN |                             |   114K |    17 M |    12 M | 21748 (1) | 00:04:21 |

| * 51 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  52.            VIEW                 | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 53 |             TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 54 |       OUTER HASH JOIN |                             |   224KO |    50 M |    14 M | 32597 (4) | 00:06:32 |

| * 55 |        HASH JOIN |                             | 64775 |    13 M |  7696K | 28458 (5) | 00:05:42 |

| * 56 |         OUTER HASH JOIN |                             | 37855.  7245K |  5416K | 26763 (5) | 00:05:22 |

| * 57 |          HASH JOIN |                             | 37675 |  4966K |       |  6436 (18) | 00:01:18 |

|  58.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 59 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 60 |           HASH JOIN |                             | 37675 |  4525K |  9320K |  4206 (27) | 00:00:51 |

|  61.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  62.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 63.            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  64.          VIEW                   | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 65 |           TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

|  66.         VIEW                    | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  67.          MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  68.        VIEW                     | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 69 |         TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 70 |       OUTER HASH JOIN |                             | 11201 |  2570K |       | 23267 (6) | 00:04:40 |

| * 71 |        HASH JOIN |                             |  3239 |   702K |       | 20816 (6) | 00:04:10 |

| * 72 |         OUTER HASH JOIN |                             |  1893 |   362K |       | 19942 (7) | 00:04:00 |

| * 73 |          HASH JOIN |                             |  1884 |   248K |       |  6435 (18) | 00:01:18 |

| * 74 |           HASH JOIN |                             |  1884 |   226K |  9320K |  4206 (27) | 00:00:51 |

|  75.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  76.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 77 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  78.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 79 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

|  80.          VIEW                   | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 81 |           TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

|  82.         VIEW                    | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  53 M |          MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  84.        VIEW                     | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 85 |         TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 86 |       OUTER HASH JOIN |                             |   560.   128K |       | 23267 (6) | 00:04:40 |

| * 87.        HASH JOIN |                             |   162. 35964 |       | 20816 (6) | 00:04:10 |

| * 88.         OUTER HASH JOIN |                             |    95. 18620 |       | 19942 (7) | 00:04:00 |

| * 89 |          HASH JOIN |                             |    94. 12690 |       |  6435 (18) | 00:01:18 |

| * 90 |           HASH JOIN |                             |    94. 11562 |  9320K |  4206 (27) | 00:00:51 |

|  91.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

|  92.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 93 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

|  94.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 95 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

|  96.          VIEW                   | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 97 |           TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

|  98.         VIEW                    | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

|  99.          MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 100.        VIEW                     | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 101 |         TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 102 |       OUTER HASH JOIN |                             |    28.  6580.       | 23267 (6) | 00:04:40 |

| * 103 |        HASH JOIN |                             |     8.  1776 |       | 20816 (6) | 00:04:10 |

| * 104 |         OUTER HASH JOIN |                             |     5.   980.       | 19942 (7) | 00:04:00 |

| * 105 |          HASH JOIN |                             |     5.   675.       |  6435 (18) | 00:01:18 |

| * 106 |           HASH JOIN |                             |     5.   615 |  9320K |  4206 (27) | 00:00:51 |

| 107.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 108.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 109 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

| 110.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 111 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| 112.          VIEW                   | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 113 |           TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| 114.         VIEW                    | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 115.          MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 116.        VIEW                     | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 117 |         TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 118 |       OUTER HASH JOIN |                             |     1.   235.       | 23267 (6) | 00:04:40 |

| * 119 |        OUTER HASH JOIN |                             |     1.   174.       |  9760 (12) | 00:01:58 |

| * 120 |         HASH JOIN |                             |     1.   161.       |  7309 (16) | 00:01:28 |

| * 121 |          HASH JOIN |                             |     1.   135.       |  6435 (18) | 00:01:18 |

| * 122 |           HASH JOIN |                             |     1.   123 |  9320K |  4206 (27) | 00:00:51 |

| 123 |            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 124.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 125 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

| 126.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 127 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| 128.          VIEW                   | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 129.           MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 130.         VIEW                    | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 131 |          TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| 132.        VIEW                     | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 133 |         TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 134 |       OUTER HASH JOIN |                             |     1.   235.       | 23267 (6) | 00:04:40 |

| * 135 |        OUTER HASH JOIN |                             |     1.   174.       |  9760 (12) | 00:01:58 |

| * 136 |         HASH JOIN |                             |     1.   161.       |  7309 (16) | 00:01:28 |

| * 137 |          HASH JOIN |                             |     1.   135.       |  6435 (18) | 00:01:18 |

| * 138 |           HASH JOIN |                             |     1.   123 |  9320K |  4206 (27) | 00:00:51 |

| 139.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 140.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 141 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

| 142.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 143 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| 144.          VIEW                   | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 145.           MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 146.         VIEW                    | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 147 |          TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| 148.        VIEW                     | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 149 |         TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 150 |       OUTER HASH JOIN |                             |     1.   235.       | 23267 (6) | 00:04:40 |

| * 151 |        OUTER HASH JOIN |                             |     1.   174.       |  9760 (12) | 00:01:58 |

| * 152 |         HASH JOIN |                             |     1.   161.       |  7309 (16) | 00:01:28 |

| * 153 |          HASH JOIN |                             |     1.   135.       |  6435 (18) | 00:01:18 |

| * 154 |           HASH JOIN |                             |     1.   123 |  9320K |  4206 (27) | 00:00:51 |

| 155.            VIEW                 | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 156.             MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 157 |            MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

| 158.           VIEW                  | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 159 |            MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| 160.          VIEW                   | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 161.           MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 162.         VIEW                    | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 163 |          TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| 164.        VIEW                     | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 165 |         TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 166 |       OUTER HASH JOIN |                             |     1.   235.       | 37689 (26) | 00:07:33 |

| * 167 |        HASH JOIN |                             |     1.   222.       | 35237 (28) | 00:07:03 |

| * 168 |         HASH JOIN |                             |     1.   210 |       | 33008 (29) | 00:06:37 |

| * 169 |          HASH JOIN |                             |  9781.  1776K |       | 22622 (1) | 00:04:32 |

| * 170 |           FILTER |                             |       |       |       |            |          |

| * 171 |            OUTER HASH JOIN |                             |  5716 |   893K |    12 M | 21748 (1) | 00:04:21 |

| * 172 |             MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1085 (2) | 00:00:14 |

| 173.             VIEW                | ABC_CDE_INDEX_AST_VW |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| * 174 |              TABLE ACCESS FULL | ABC_CDE_INDEX_AST |  1898K |   110 M |       | 13499 (1) | 00:02:42 |

| 175.           VIEW                  | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 176.            MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| * 177 |          VIEW                   | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 178.           MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 179.         VIEW                    | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 180 |          MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| 181.        VIEW                     | ABC_CDE_INDEX_CHG_VW |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| * 182 |         TABLE ACCESS FULL | ABC_CDE_INDEX_CHG |   818K |    10 M |       |  2448 (1) | 00:00:30 |

| 183.   LOAD SELECT ACE | SYS_TEMP_0FD9FCB73_F58FAD20 |       |       |       |            |          |

| 184.    VIEW                         |                             |   145K |    18 M |       |   187 M (1) | 625:08:34 |

| 185.     UNIQUE FATE |                             |   145K |    22 M |  1215G |   187 M (1) | 625:08:34 |

| * 186 |      HASH JOIN |                             |  7487M |  1122G |       |   274K (98) | 00:54:59 |

| 187.       VIEW                      | STAG_MASTER_VW | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 188 |        MAT_VIEW FULL ACCESS | STAG_MASTER_MV | 39985 |   468K |       |  2229 (1) | 00:00:27 |

| * 189 |       HASH JOIN |                             |  7487M |  1039G |  9320K |   245K (98) | 00:49:06 |

| 190.        VIEW                     | STAG_MANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| 191.         MAT_VIEW FULL ACCESS | STAG_AANAME_MV |   264K |  6208K |       |   974 (1) | 00:00:12 |

| * 192 |        HASH JOIN |                             |   248K |    29 M |  9240K |  2995 (1) | 00:00:36 |

| 193.         VIEW                    | STAG_NAMADDS_VW |   248K |  6316K |       |   872 (1) | 00:00:11 |

| 194.          MAT_VIEW FULL ACCESS | STAG_NAMADDS_MV |   248K |  6316K |       |   872 (1) | 00:00:11 |

| * 195 |         MAT_VIEW FULL ACCESS | STAG_ANAME_MV |   113K |    10 M |       |  1075 (1) | 00:00:13 |

| 196.   UNIQUE FATE |                             |   352K |    60 M |    72 M | 17677 (12) | 00:03:33 |

| 197.    UNION-ALL |                             |       |       |       |            |          |

| * 198 |     VIEW                        |                             |   352K |    60 M |       |  1883 (1) | 00:00:23 |

| 199.      TABLE ACCESS FULL | SYS_TEMP_1234_5678 |   352K |    60 M |       |  1883 (1) | 00:00:23 |

| * 200 |     FILTER |                             |       |       |       |            |          |

| * 201 |      OUTER HASH JOIN |                             |     1.   150.       |  1982 (1) | 00:00:24 |

| * 202 |       HASH JOIN |                             |     1.   142.       |    97 (2) | 00:00:02 |

| 203.        VIEW                     |                             | 11540 | 92320 |       |    48 (0) | 00:00:01 |

| 204.         TABLE ACCESS FULL | SYS_TEMP_3456_0987F0 | 11540 |  1 510 K |       |    48 (0) | 00:00:01 |

| 205.        VIEW                     |                             | 11540 |  1 510 K |       |    48 (0) | 00:00:01 |

| 206.         TABLE ACCESS FULL | SYS_TEMP_0987F0_3456 | 11540 |  1 510 K |       |    48 (0) | 00:00:01 |

| 207.       VIEW                      |                             |   352K |  2757K |       |  1883 (1) | 00:00:23 |

| 208.        TABLE ACCESS FULL | SYS_TEMP_09kjhn0_3456 |   352K |    60 M |       |  1883 (1) | 00:00:23 |

-----------------------------------------------------------------------------------------------------------------------

{code}

Thank you.

Well, that was just a guess because you don't want to share the query, nor execution plan with actual cardinalities. The goal is probably to avoid the separate.

Tags: Database

Similar Questions

  • SQL not using indexes at runtime, but by using the index in "explain plan".

    Hi all

    I am facing a problem here that I don't get to think.

    I have a SQL that makes a FULL ACCESS of TABLE into two tables and its costs are very high, but it occurs only when I run it in my program (I saw it in the session trace). If I do a "explain plan" sqlplus (SQL Navigator or PLSQL Developer) it shows that he use indexes and have a low cost. I already checked the statistics from both tables, and they are up to date.

    Did someone never facing a similar problem or knows something I can do to find my problem?

    Thank you all very much.

    Hello

    As far as I KNOW, optimizer Oracle never guarantees that an Index scan in query explain plan will be necessarily used during query execution.

    ORACLE-BASE - DBMS_XPLAN: Oracle display execution Plans

    Could you please read the above, run the query, as described and check the execution using DBMS_XPLAN plan. The cursor cache DISPLAY_CURSOR and not PLAN_TABLEs.

  • change / stop the query using bad plan

    I use 11.2.0.3.  I'm wrong a script with multiple insert into... Select.  One of the insert running for hours because it is using bad plan because of State statistics.   I've now updated the statistics. Is - it there anyway I can do oracle raise this insert or ignore this insert and continue with the other inserts in my script. (I don't want to kill the session, I want to run other sqls).

    Also, for the future is there a way to make oracle dynamic sampling rather than obsolete statistics usage?

    I was able to cancel the query in another session to help

    execDBMS_RESOURCE_MANAGER.SWITCH_CONSUMER_GROUP_FOR_SESS (sid, serial#, 'CANCEL_SQL');

  • How to optimize the query with a join of virtual tables

    I'm working on a query that is get the data of virtual tables 2 and b
    one is formed by the Union, all say 4 queries and b is formed by the Union, all say 3 queries
    then these two virtual tables and b are joined on a column common and data are extracted from their part.
    Problem is that there is about 1 minutes each in the two virtual tables has and b. If individual a and b queries virtual takes about 5 seconds to retrieve data
    but the join on column takes about 25 seconds to retrieve data.
    Can someone guide me how to optimize the recovery of joining 2 virtual tables having large data

    Thank you

    Please read these:

    When your query takes too long
    When your query takes too long...

    How to post a SQL tuning request
    HOW to: Validate a query of SQL statement tuning - model showing

  • Optimize the query using SUBSTR

    Hi, I wrote the following to get the string 'abc' in the following input strings


    ' 2010/abc' and
    ' 2010/inv/abc '.

    I have to get the string ("abc") that is after the last ' / '.
    In the entrance of the channels the ' / ' can be 1 or 2

    So I tried the following
    select substr(substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')),
    (instr(substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')),
    '/',1,1)+1),length (substr('2010/abc',(instr('2010/abc','/',1,1)+1),length('2010/abc inst')))) str from dual
    The Select query above is even working for the string "abc/2010/inv" (until the 2nd "/" only it works)

    Could please minimize the above query, and which may even work you for same 3rd or 4th ' / '.


    Thank you

    Hello

    Alternatively, you can use regexp if you want:

    Scott@my10g SQL>l
      1  with data as (
      2  select '2010/abc' str from dual
      3  union all select 'inv/2010/abc' from dual
      4  union all select 'inv/2010/inv/2010/abc' from dual
      5  union all select 'abc' from dual
      6  )
      7* select str, regexp_substr(str,'[^/]+$') sstr from data
    Scott@my10g SQL>/
    
    STR                   SSTR
    --------------------- ----------
    2010/abc              abc
    inv/2010/abc          abc
    inv/2010/inv/2010/abc abc
    abc                   abc
    

    It would be up to the end of the string from the last source / (or early if no / in the source string)

  • Optimize the query

    Hi all

    I have a question and I would like to know how to optimize it. Please suggest. :-

    select   *
    from unity_list o  where  (exists (
        select * from opp_date
        where opp_id = o.opp_id
        and date_type = 'FYIMSAT') and :maySubmitAnytime = 'Y')  OR (:maySubmitAnytime = 'N' and not exists (
        select * from em_preaward.opp_date
        where opp_id = o.opp_id
        and date_type = 'FYIMSAT')) OR :maySubmitAnytime IS NULL
    order by o.reviewed DESC, o.changed_ind DESC, o.opp_desc
    

    Please suggest.

    I have a question and I would like to know how to optimize it. Please suggest. :-

    He returned lines of 5 billion in less than a microsecond. Why do you think he needs optimized?

  • How to keep the formatting explain plan made on this forum

    Can you please tell me as a way to preserve the formatting of explain plan made on this forum. I tried to use the '-' tag, but failed.

    \

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------

    Hash value of plan: 615168685

    ---------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ---------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |      |    23.  1242.     7 (15) | 00:00:01 |

    |*  1 |  HASH JOIN |      |    23.  1242.     7 (15) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |    13.   234.     3 (0) | 00:00:01 |

    |   3.   TABLE ACCESS FULL | EMP |    23.   828 |     3 (0) | 00:00:01 |

    ---------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("E".") DEPTNO "=" D ". ("' DEPTNO ')

    15 selected lines.

    \

    Go to advanced editor and change the font to a fixed-width font e.g. Courier New

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------

    Hash value of plan: 615168685

    ---------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ---------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |      |    23.  1242.     7 (15) | 00:00:01 |

    |*  1 |  HASH JOIN |      |    23.  1242.     7 (15) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | DEPT |    13.   234.     3 (0) | 00:00:01 |

    |   3.   TABLE ACCESS FULL | EMP |    23.   828 |     3 (0) | 00:00:01 |

    ---------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("E".") DEPTNO "=" D ". ("' DEPTNO ')

    15 selected lines.

  • Look at an explain plan

    version 11.2.0.4.0

    Solaris x 64 operating system

    Toad 9.0

    Hi, I'm trying to give a new user privleges see explain the plan. for this, I did the following

    grant select_catalog_role < username >;

    Grant execute on sys.dbms_xplan_type < username >;

    Grant execute on sys.dbms_xplan_type_table < username >;

    It didn't work, and then I have granted the select privilege on the table of existing plan to a new user.

    Grant select on sys.plan_table < username >;

    create synonym plan_table for sys.plan_table

    Yet it did not work, I got the error "ORA-01031: insufficient privileges" when you try to view explain plan.

    I even tried to create a new table of plan in this new scheme of the user by running the utlxplan.sql, but I get an error message saying that the table already exists.

    can someone help me please on where I'm wrong.

    Thank you

    «The question one EXPLAIN PLAN statement, you must have the necessary privileges to insert rows into a table of existing output that you specify to hold execution plan.»

    You must also have the necessary privileges to run the SQL statement to determine the execution plan. If the SQL statement accesses a view, you must have privileges to access any tables and views on which the opinion is based. If the view is of another opinion which is based on a table, you must have privileges to access the other point of view and its underlying table.

    To examine the execution plan produced by a EXPLAIN PLAN statement, you must have the necessary privileges to query the table of output.

    The EXPLAIN PLAN statement is a statement data manipulation language (DML), rather than a data definition language (DDL) statement. Therefore, Oracle database does not implicitly commit changes made by one EXPLAIN PLAN statement. If you want to keep the lines that are generated by a EXPLAIN PLAN in the output table, then you must commit to the transaction that contains the statement. »

    http://docs.Oracle.com/CD/E16655_01/server.121/e17209/statements_9010.htm#sthref6316

  • Decode the query help

    Hello
    I'm new to the development of Oracle.
    Oracle 10 g 2

    My original query:

    SELECT APP, count (*)
    TRANSACTION
    WHERE TYPE in ('ShipmentConfirmPR', 'ShipmentConfirm', 'ShipConfirm')
    and the APP ("SAPPI", "SAPPI", "SAPR3") and INTERVENE ('9320 ', '9332','1208 ')
    GROUP BY APP TYPE
    order of the APP

    the result of this query:
    SAPPI 100
    SAPPI 600
    SAPR3 440

    My requirement
    And I want to have something like output

    LDCS 100
    TSW 600
    PDC 440

    IE.the APPP and STEP combinations. Must return the specified values
    SAPPI & 9320-> LOC (here SAPPI IE APP is the same for both... but it's a coincidence IE APP can be sliced also)
    SAPPI & 9332-> tsw
    SAPR3 & 1208-> pdc

    Options, I tried:
    Query provided by one of the Forum members...
    SELECT THE CHECK BOX
    WHEN APP = "SAPP1" THEN DECODE (step, '9320', 'LSW', '9332', "TSW")
    WHEN APP = "SAPR3" step = '1208' AND 'PDC '.
    END app
    COUNT (*)
    TRANSACTION
    WHERE TYPE in ('ShipmentConfirmPR', 'ShipmentConfirm', 'ShipConfirm')
    AND THE APP ("SAPPI", "SAPPI", "SAPR3")
    AND STEP IN ('9320', '9332', ' 1208')
    GROUP BY APP, STEP
    ORDER OF THE APP.

    EXECUTION PLAN

    | ID | Operation | Name |
    ------------------------------------------------------------------------
    | 0 | SELECT STATEMENT |
    | 1. GROUP SORT BY |
    | 2. INLIST ITERATOR.
    | 3. TABLE ACCESS BY INDEX ROWID | TRANSACTION |
    | 4. INDEX RANGE SCAN | TRANSACTION_IDX |


    The output of the query (as above) must partially match the following query (a particular combination of CLO)

    SELECT count (1)
    TIBCO. TRANSACTION_HISTORY
    WHERE TYPE = 'ShipmentConfirm '.
    and APP in ("SAPPI") and INTERVENE ('9332')


    My Questions:

    1.*There are indexes on all 3 APP passes it's IE, STEP and TYPE *. I don't want a FULL table Scan (as one would use the index). Can change us the query / use of indices, etc. to make it faster?

    2. is the right to approach? Would the use of the concat operator in the function decode work better for my needs?
    Something like

    Select decode (APP |) STEP, 'SAPP9332', 'X') of TRANSACTION_HISTORY where < COND >

    If Yes can you please provide the query?

    3. ANY other approach / request for my requirement.

    Thanks in advance.

    Hello

    user13517642 wrote:
    ... EXECUTION PLAN

    | ID | Operation | Name |
    ------------------------------------------------------------------------
    | 0 | SELECT STATEMENT |
    | 1. GROUP SORT BY |
    | 2. INLIST ITERATOR.
    | 3. TABLE ACCESS BY INDEX ROWID | TRANSACTION |
    | 4. INDEX RANGE SCAN | TRANSACTION_IDX |

    The output of the query (as above) must partially match the following query (a particular combination of CLO)

    SELECT count (1)
    TIBCO. TRANSACTION_HISTORY
    WHERE TYPE = 'ShipmentConfirm '.
    and APP in ("SAPPI") and INTERVENE ('9332')

    My Questions:

    1.*There are indexes on all 3 APP passes it's IE, STEP and TYPE *. I don't want a FULL table Scan (as one would use the index). Can change us the query / use of indices, etc. to make it faster?

    A full table scan might be the fastest way to get results. Do you have any reason to think that it would be faster to go through the index? How selective are the clues? In other words, what is the percentage of rows in the table correspond to each of the values in the WHERE clause?

    2. is the right to approach?

    It depends on what you're trying to do, which is not at all clear to me.

    Would the use of the concat operator in the function decode work better for my needs?
    Something like

    Select decode (APP |) STEP, 'SAPP9332', 'X') of TRANSACTION_HISTORY where

    If you use this approach, look out for the problem Ab asse crevit . For example, if you have these 4 rows and 2 columns:

    str1     str2
    ----     ----
    (NULL)     FOO
    F     OO
    FO     O
    FOO     (NULL)
    

    There are 4 values of distict of str1 (counting NULL) and 4 separate values of str2, str1 but | str2 is the same for each of them. In the above example, it there is no way to know, just by looking at the concatenated string, including str1 and str2 ends begins. Maybe it's not the case for your specific data (for example, if the application is still exactly 5 characters long). otherwise, you may need to add some kind of delimiter, like this

    app || '+' || step
    

    where you know that '+' never occurs in one of these columns.

    3. ANY other approach / request for my requirement.

    CASES, as I mentioned in your previous message:
    Decode the help function
    and as you have used above.

    In this thread, you said "I have to use the decode function. Why? It is a competition of school Etudieeo DECODE is explicitly required? Why you don't want in the best way, what that turns out to be?

    Your WHERE clause:

    AND APP IN ('SAPPI', 'SAPPI', 'SAPR3')
    AND STEP IN ('9320', '9332', '1208')
    

    admits 6 possible combinations of APA and step:

    app     step
    -----     ----
    SAPP1     9320
    SAPP1     9332
    SAPP1     1208
    SAPP3     9320
    SAPP3     9332
    SAPP3     1208
    

    but you are looking for only 3 of these combinations in DECODE it or the expression BOX. (Have 2 copies of 'SAPP1' e list won't do any good, but it does hurt real, either.)
    By the way, is "SAPPI" app with the letter 'I' at the end, or "SAPP1", with the number '1' at the end?

    Published by: Frank Kulash, March 24, 2011 19:44

  • Book advises explain plan

    Hi guys,.

    I have 2 questions. The first is as you know before, I would like to learn the secrets behind explain plan and how how oracle works behind the scene. I have studied some books. I found Oracle SQL Tuning: A Close Look at explain Plans by Dan Hotka. Do you recommend this book? I just read a page of this book, I thnik the language of this book is simple and he explains the situation from the beginning. In my view, it is helpful for beginners like me. Because things get difficult to learn in first time for beginners. As a result I just want to learn you recommend this book?

    My second question is, I want to buy this book, but I couldn't find in England (Paperback, not e book). But appereantly I have to buy online as ebook. Do you know any site web confidence that I can buy the ebook of this book version?

    Thanks a lot for your help.

    944258 wrote:
    Hi guys,.

    I have 2 questions. The first is as you know before, I would like to learn the secrets behind explain plan and how how oracle works behind the scene. I have studied some books. I found Oracle SQL Tuning: A Close Look at explain Plans by Dan Hotka. Do you recommend this book? I just read a page of this book, I thnik the language of this book is simple and he explains the situation from the beginning. In my view, it is helpful for beginners like me. Because things get difficult to learn in first time for beginners. As a result I just want to learn you recommend this book?

    Hi, why not start here everything first: http://www.orafaq.com/node/1420. There is probably more information about execution plans available online, as it is in the books. At least the part that you want to find out and try to remember will be available online :-)

    >

    My second question is, I want to buy this book, but I couldn't find in England (Paperback, not e book). But appereantly I have to buy online as ebook. Do you know any site web confidence that I can buy the ebook of this book version?

    http://www.Amazon.com/Oracle-SQL-Tuning-close-explain/DP/1453804196

    See you soon
    FJFranken

  • explain plan for the same query diff

    Hi experts,

    Please, help me understand explain the plan.  I have tow Server (server and two server). The server are same table, even the type of database, even version Oracle (gr 11 (2), same operating system (linux Redhat 5.5) and same table and index.

    but when I explain the plan for the same query on the two server. I got diff--diff to explain the plan. reason it has different, according to my understanding, it should be same. explain please, I share the explain plan and lower indices for the two server.

    Server a

    SQL > col COLUMN_NAME format a20

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

    ------------------------------ -------------------- ---------------

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    3 union

    4. Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

    -------- ------------------------------ ------------------------------ --------

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 3659874059

    ------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

    ------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANTYPE"=1 AND "LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    16 selected lines.

    Second server

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

    ------------------------------ -------------------- ---------------

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    Union

    3 4 Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

    -------- ------------------------------ ------------------------------ --------

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 1161680601

    ----------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ----------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |     2.    84.     5 (0) | 00:00:01 |       |       |

    |*  1 |  FILTER                             |                            |       |       |            |          |       |       |

    |*  2 |   TABLE ACCESS BY INDEX ROWID | LOAN_RUNNING_DETAILS_SOUTH |     2.    84.     5 (0) | 00:00:01 | ROWID | ROWID |

    |*  3 |    INDEX RANGE SCAN | DATE_IND1_S |     2.       |     3 (0) | 00:00:01 |       |       |

    ----------------------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    2 - filter ("LOANTYPE" = 1)

    3 - access("LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    17 selected lines.

    Reg,

    Hard

    Hi , HemantKChitale,

    I also update statistics manual as you say, but not see 'TABLE ACCESS FULL' good result

    What should I do? my need of production tuning, but I cannot able tune this...

    SQL > exec dbms_stats.gather_table_stats (-online 'ttt' ownname, tabname => 'LOAN_RUNNING_DETAILS_SOUTH', cascade => TRUE, estimate_percent => NULL, method_opt => 'for all columns size 254', => of degree 4);

    PL/SQL procedure successfully completed.

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME<=sysdate-2 and="" loandatetime="">sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 3659874059

    ------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

    ------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANDATETIME">SYSDATE@!-15 AND "LOANTYPE"=1 AND "LOANDATETIME")<>

    16 selected lines.

  • To the topic to explain the query Plan

    Hello

    I have a question about the explain plan command. While gather us statistics and optimize, then choose the best possible plan out the plans explain command available. If we collect statistics on a table for a long time while the system choose:

    Whether it will continue to use the same plan, since it uses at startup when statistics have been collected, or will change the plan as soon as dml activities and statistics grow old.

    Thank you
    GK

    Gulshan says:
    Hello

    I have a question about the explain plan command. While gather us statistics and optimize, then choose the best possible plan out the plans explain command available. If we collect statistics on a table for a long time while the system choose:

    The same plan he chose to start with previous statistics. The plan will not change automatically as long as you update the statistics.

    Whether it will continue to use the same plan, since it uses at startup when statistics have been collected, or will change the plan as soon as dml activities and statistics grow old.

    The DML will not be able to change the statistics stored in the data dictionary views themselves. There must be a statistic explicit collection that has come to reflect the change in the data dictionary. 10 g from, there is automatically a task (a special 11 g automatic) is there who can detect the change in the ongoing dml on the table and can trigger the table for update statistics.

    Aman...

  • Explain the explain plan

    decide to move to optimization soon. Book says join faster that the subquery in this example because the analyses involved. The "cost" to the subquery appears lower than the cost for the join. So it is confusing to me - aka How should I be interpreting this.

    Plan of subquery:

    image2.png.jpg

    join plan

    image2.png.jpg

    as you can see that the plan for the subquery has less than a cost. Could someone explain these outputs as to which application is more effective. I need to start somewhere.

    Thank you!

    The BEST way to get help when you ask questions is:

    1 ask questions on SPECIFIC things

    2. tell us EXACTLY what term, value, etc. ask abaout

    Book says join faster that the subquery in this example because the analyses involved. The "cost" to the subquery appears lower than the cost for the join. So it is confusing to me - aka How should I be interpreting this.

    OK - what BOOK are you talking about? There is not much interest to mention a book if you're not going to tell us which book it and provide a link to it and even a page number. This gives us the SCOPE of your question.

    This "cost for the subquery" are you talking about? Be specifc. It is in one of the plans that you posted? What plan? Whose cost is it? For example, you could say:

    I have a question for the foreground below. Why is the cost to the xx line lower than the cost of the second plan on line AA?

    This question refers CLEARLY to the info we're talking. The way in which you stating the question, we try to guess what plan and the lines you want to say.

    subquery plan:
    
    
    join plan
    
    
    as you can see the subquery plan has less of a cost. Could someone explain from these outputs as to which query is more efficient. I need to start from somewhere.
    

    Are you talking about line #1 in each of these plans?

    Please edit your post and tell us EXACTLY what you ask in the topic and refer to values and SPECIFIC lines. Also post a link to the book and a reference to a page number you got the information from.

    The optimizer generally chooses the REAL implementation with the lowest cost plan. It is not clear whether the plans that you have posted are ACTUAL spending plans that Oracle really determined and used or just explain plans.for what Oracle thought it might use.

    If the statistics are not up-to-date these plans do not yet reflect the reality of the data.

    And if the amount of data is a small number of blocks or other of these plans can run better than the other in reality.

    You can find this Oracle white paper "Explain the Plan explaining" useful

    http://www.Oracle.com/technetwork/database/bi-Datawarehousing/TWP-explain-the-explain-plan-052011-393674.PDF

  • Should I wait until the end of the execution time of the query for the execution plan?

    Hello Experts,

    I want to see the execution plan of the query below. However, it takes more than 3 hours. Should I wait all the time to see the execution plan?

    Note: EXPLAIN PLAN for does not work. (I mean that I do not see the actual line number, etc. with EXPLAIN the PLAN of market)

    You can see the output of the execution plan when I canceled the execution after 1 minute.

    My first question is: what should I do to see the execution plan for queries running out of time time?

    2nd question: when I cancel the query during execution in order to see the execution plan, will I see the specific plan of execution or erroneous values? Because the first execution plan seems inaccurate, what do you think?

    question 3: why EXPLAIN the PLAN for the clause does not work? Also, should I use EXPLAIN the PLAN of the clause to this scenerio? Can I see the result of running for long time without her queries?

    Thnaks for your help.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    CORE Production 11.2.0.2.0

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SQL_ID, dznya6x7st0t8, number of children 0

    -------------------------------------

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT,.

    J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price of

    CustInvoiceJour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    Hash value of plan: 2002317666

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                           | Begins | E - lines. A - lines.   A - time | Pads | Bed |  OMem |  1Mem | Used Mem.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                                |      1.        |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  1 |  HASH JOIN |                                |      1.   3956.      0 | 00:00:00.01 |       0 |      0 |  2254K |  1061K | 2190K (0) |

    |*  2 |   HASH JOIN |                                |      1.     87.  16676. 00:00:01.64 |     227K |   3552.  3109K |  1106K | 4111K (0) |

    |*  3 |    TABLE ACCESS BY INDEX ROWID | CUSTINVOICEJOUR |      1.   1155 |  31889 | 00:00:01.16 |     223KO |     15.       |       |          |

    |*  4 |     INDEX RANGE SCAN | I_062INVOICEDATEORDERTYPEIDX |      1.   4943 |    134K | 00:00:00.83 |   45440 |      0 |       |       |          |

    |   5.    SIMPLE LIST OF PARTITION.                                |      1.  82360 |    173K | 00:00:00.08 |    3809 |   3537 |       |       |          |

    |*  6 |     TABLE ACCESS FULL | AVTR_SEG_CUST_CAMPEND |      1.  82360 |    173K | 00:00:00.06 |    3809 |   3537 |       |       |          |

    |   7.   TABLE ACCESS BY INDEX ROWID | CUSTINVOICETRANS |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  8 |    INDEX RANGE SCAN | I_064INVLINENUMCAMPAIGNOFPRICE |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("J".") "SYS_NC00299$"="T". "' SYS_NC00165$ ' AND SUBSTR (NLS_LOWER ('J'. "" "" REFFACTURE")(, 1, 25) = SUBSTR (NLS_LOWER ("T"." "" "REFFACTURE")(, 1, 25)).

    2 - access("J".") INVOICEACCOUNT '= SYS_OP_C2C ("EC". ". ACCOUNTNUM'))

    3 - filter("J".") AVAWARDSALES"> 190)

    4 - access("J".") SYS_NC00299$ "= U ' 201"AND "J". INVOICEDATE"> = TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND

    "J"." SYS_NC00307$ "= U ' 201406"AND "J". INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss')))

    filter ((' J'. "INVOICEDATE' > = 'J' AND TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') '." " SYS_NC00307$ "= U '201406' AND"

    "J"." INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss'))))

    6 filter (("CE". "SEGMENT_LEVEL" = A "OR"THIS"." SEGMENT_LEVEL "=" E"))

    8 - access("T".") SYS_NC00165$ "= U ' 201"AND "T". AVBROCHURELINENUM "= 29457)

    filter ("T". ("AVBROCHURELINENUM" = 29457)

    EXPLAIN PLAN FOR

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR);

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR ('7h1nbzqjgwsp7', 2));

    SQL_ID, 7h1nbzqjgwsp7, number of children 2

    EXPLAIN PLAN for select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * /.

    J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE,

    (T.LINEAMOUNT + T.LINEAMOUNTTAX) join price j custinvoicejour

    CustInvoiceTrans t on substr (nls_lower (j.dataareaid), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    NOTE: cannot fetch SQL_ID plan: 7h1nbzqjgwsp7, CHILD_NUMBER: 2

    Check the value of SQL_ID and CHILD_NUMBER;

    It could also be that the plan is no longer in the cursor cache (check v$ sql_plan)

    NightWing wrote:

    Randolf,

    I don't understand. What you hear from the above statement that you mean A-lines and E will be incorrect, but the ratio between them remain the same. Therefore, you can deduct the bad things by comparing the differences.

    Thus, A-lines always give a wrong result for cancellation of queries, isn't it?

    Charlie,

    I think that Martin gave a good explanation. Here's another example that hopefully makes more obvious things:

    17:56:55 SQL >-things go very wrong here with a small buffer cache

    17:56:55 SQL >-T2 lines are badly scattered when you access through T1. FK

    17:56:55 SQL >--

    17:56:55 SQL >-"Small job" approach would have been a good idea

    17:56:55 SQL >-if the estimate of 100 iterations of the loop was correct!

    17:56:55 SQL > select

    17:56:55 (t2.attr2) count 2

    17:56:55 3 of

    17:56:55 4 t1

    17:56:55 5, t2

    17:56:55 6 where

    17:56:55   7  /*------------------*/

    17:56:55 8 trunc (t1.attr1) = 1

    17:56:55 9 and trunc (t1.attr2) = 1

    17:56:55 10 / *-* /.

    17:56:55 11 and t1.fk = t2.id

    17:56:55 12.

    T1

    *

    ERROR on line 4:

    ORA-01013: user has requested the cancellation of the current operation

    Elapsed time: 00:04:58.30

    18:01:53 SQL >

    18:01:53 SQL > @xplan_extended_display_cursor ' ' ' ' 'ALLSTATS LAST + COST.

    18:01:53 SQL > set echo off verify off termout off

    SQL_ID, 353msax56jvvp, number of children 0

    -------------------------------------

    SELECT count (t2.attr2) from t1, t2 where

    / / *-* trunc (t1.attr1) = 1 and

    trunc (T1.attr2) = 1 / *-* / and t1.fk = t2.id

    Hash value of plan: 2900488714

    ------------------------------------------------------------------------------------------------------------------------------------

    | ID | The NEST | DSB | Operation | Name | Begins | E - lines. Cost (% CPU). A - lines.   A - time | Pads | Bed |

    ------------------------------------------------------------------------------------------------------------------------------------

    |   0 |     |   7. SELECT STATEMENT |        |      1.        |  4999 (100) |      0 | 00:00:00.01 |       0 |      0 |

    |   1.   0 |   8 2 GLOBAL TRI |        |      1.      1.            |      0 | 00:00:00.01 |       0 |      0 |

    |   2.   1.   5.   NESTED LOOPS |        |      1.        |            |  57516 | 00:04:58.26 |     173K |  30770 |

    |   3.   2.   3.    NESTED LOOPS |        |      1.    100.  4999 (1) |  57516 | 00:00:21.06 |     116K |   3632.

    |*  4 |   3.   1.     TABLE ACCESS FULL | T1 |      1.    100.  4799 (1) |  57516 | 00:00:00.19 |    1008 |   1087 |

    |*  5 |   3.   2.     INDEX UNIQUE SCAN | T2_IDX |  57516 |      1.     1 (0) |  57516 | 00:00:20.82 |     115K |   2545 |

    |   8 2 2 |   4.    TABLE ACCESS BY INDEX ROWID | T2 |  57516 |      1.     2 (0) |  57516 | 00:04:37.14 |   57516 |  27138 |

    ------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    4 filter ((TRUNC ('T1'. "ATTR1") = 1 AND TRUNC ('T1'. " ATTR2') = 1))

    5 - access("T1".") FK '= 'T2'.' (ID')

    You say here that I canceled a query after about 5 minutes, and looking at the statistics of content (RowSource) I can already say the following:

    1. the estimation of cardinality of T1 is far - the optimizer estimated 100 lines, but it actually generated more than 57000 lines when the query was cancelled. If this definitely seems like a candidate at the origin of the problems

    2. the query has spent most of the time in search of random table T2

    So while it is true that I don't know final A-lines of this cancelled query information, I can still say a lot of this and begin to deal with the problems identified so far.

    Randolf

  • [8i] can someone help me on the use to explain the plan, tkprof, etc.. ?

    I'm trying to follow the instructions when your query takes too long...

    I'm trying to understand why a simple query take so long.

    The query is:
     SELECT COUNT(*) AS tot_rows FROM my_table;
    It takes 5 minutes to run (better), and the result is approximately 22 million (total of lines).

    My generic username does not (obviously) allow access to PLAN_TABLE, so I had to open a session in the SYSTEM to run explain plan. In SQL * Plus, I typed in:
    explain plan for (SELECT COUNT(*) AS tot_rows FROM my_table);
    and the answer is 'explained '.

    It's supposed to give me some sort of output, or am I missing something?

    Then, the next step in the post I linked should use tkprof. I see that it says it will display a file path specified in the parameter. The only problem is, I don't have access to the db server. I work remotely and do not have anyway (remotely or directly) access the db server. Is it possible to have the output to my local computer file, or am I just S.O.L.?

    How to hide is to run parallel processes for a query more quickly?

    Well, that's why Oracle to invent it.

    But the degree to which you use parallel processing (and effectiveness) depends on the amount of resources you have.

    If you apply the concept poorly, it is possible that a sql statement can take more time under Parallels. PX has some overhead.

    Would you recommend I have ask to my IT Department. collect statistics on this table?

    I can't. Statistics management is a BIG deal and not something that can be easily summed up in a post on the forum.

Maybe you are looking for

  • Impossible to pass iPhone iOS 9.2 6

    I have an iPhone 4S and just got an iPhone 6. I'm trying to restore my my 4 s backup 6.  When I do this I get a pop message, saying that the backup cannot be restored to this iPhone because the software on the iPhone is too old.  Then, I set up the p

  • b9k34pa: pavilion G6-2118tu chipset drivers

    Replace hard drive dead & try to get everything up and running. Web site HP says that there is no driver for this model. Of course, I don't have the recovery discs! Can someone point me to the URL with the correct drivers. Driver Chipset would allow

  • How to choose a song where I left off?

    I'm sure there must be a simple answer to this, but if I turn off my Sansa Connect, while he plays a song, how to pick up where it left off when I turn it back?

  • All the tools of Management\Administrator has disappeared - restore disabled, no run command, msconfig, etc..

    My daughter has run an .exe file on her netbook and has been infected. The antivirus (MS Essentials) got off, restore power off, msconfig and the management of all tools would appear on the screen and then disappear. Online scanners didn't work, even

  • Gateway SSL / ACS deployment / running * bat files

    My current setup works with users who authenticate via ACS. The proxy settings get downloaded to the client based on which group he belongs on ACS. I would like to see if I can't launch the good old *.bat file while a user opens a session. The main i