DECODE is changing the explain plan

I have a statement with a decoding function in the where clause like this:
AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)
When I have a package-1 as parameter for cropgroup the filter would result by ' AND '-1' = '-1', and the statement is executed in less than 2 seconds.»»» When I leave this where clause it takes almost 18 seconds. The result is the same so I don't understand why the explain plan command is so different and why not use index scans in the statement without decoding.

Below plans to explain and tkprofs to 1 (no decode) and 2 (decode).

* explain 1 *.
{code}
SQL statement that produced these data:
Select * from table (dbms_xplan.display)

PLAN_TABLE_OUTPUT

---------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | TempSpc | Cost (% CPU).
---------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 7080 | 2413K | 43611 (2) |
| 1. SORT ORDER BY | 7080 | 2413K | 5224K | 43611 (2) |
|* 2 | FILTER |
|* 3 | HASH JOIN | 7156. 2 438 K | 43075 (2) |
| 4. TABLE ACCESS FULL | DWH_ABS_DETERMINATION | 17745. 363KO | 83 (0) |
|* 5 | OUTER HASH JOIN | 7156. 2292K | 42991 (2) |
|* 6 | HASH JOIN | 7156. 1355K | 42907 (2) |
|* 7 | HASH JOIN | 6987. 1187K | 19170 (2) |
|* 8 | HASH JOIN | 6947 | 963K | 10376 (1) |
|* 9 | TABLE ACCESS BY INDEX ROWID | ALIQUOT | 3. 144. 3 (0) |
| 10. NESTED LOOPS | 6907. 897K | 8577 (1) |
| * 11 | HASH JOIN | 2264 | 187K | 1782 (2) |
| 12. TABLE ACCESS BY INDEX ROWID | SAMPLE | 190. 4370. 17 (0) |
| 13. NESTED LOOPS | 2264 | 152K | 107 (1) |
| 14. NESTED LOOPS | 12. 552. 25 (0) |
| * 15 | TABLE ACCESS FULL | SDG_USER | 12. 288. 13 (0) |
| 16. TABLE ACCESS BY INDEX ROWID | SDG | 1. 22. 1 (0) |
| * 17. INDEX UNIQUE SCAN | PK_SDG | 1 | | | 0 (0) |
| * 18. INDEX RANGE SCAN | FK_SAMPLE_SDG | 597. 2 (0) |
| 19. TABLE ACCESS FULL | SAMPLE_USER | 1078K | 16 M | 1669 (1) |
| * 20. INDEX RANGE SCAN | FK_ALIQUOT_SAMPLE | 3 | | | 2 (0) |
| 21. TABLE ACCESS FULL | ALIQUOT_USER | 3403K | 29 M | 1781 (3) |
| 22. TABLE ACCESS FULL | TEST | 3423K | 104 M | 8775 (2) |
| * 23. TABLE ACCESS FULL | RESULT | 3435K | 65 M | 23718 (2) |
| 24. VIEW | PLATE | 21787 | 2851K | 84 (2).
| * 25. FILTER |
| 26. TABLE ACCESS FULL | PLATE | 21787 | 574K | 84 (2).
| * 27. INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1. 7 | | 0 (0) |
| * 28. INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1. 7 | | 0 (0) |
| * 29. INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1. 7 | | 0 (0) |
| * 30 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1. 7 | | 0 (0) |
| * 31. INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1. 7 | | 0 (0) |
---------------------------------------------------------------------------------------------------------------

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

2. ((«GROUP_ID» EST NULL ou EXISTE (SELECT / * + * / 0 DE "AGIL".) filter)) "OPERATOR_GROUP"
"OPERATOR_GROUP' WHERE ' OPERATOR_ID"="LIMS$ OPERATOR_ID" () AND "GROUP_ID" =:B1)) AND ('GROUP_ID' IS NULL) "'". "
OR EXISTS (SELECT / * + * / 0 "LIMS".) ' ' OPERATOR_GROUP ' 'OPERATOR_GROUP' WHERE
"OPERATOR_ID"="LIMS$ OPERATOR_ID" () AND "GROUP_ID" =:B2)) AND ('GROUP_ID' IS NULL OR EXISTS (SELECT / * +)) "" "."
* / 0 "LIMS". "' OPERATOR_GROUP ' 'OPERATOR_GROUP' WHERE ' OPERATOR_ID"="LIMS$ OPERATOR_ID" () AND "."
(('GROUP_ID' =: B3)) AND ('GROUP_ID' IS NULL OR EXISTS (SELECT / * + * / 0 "LIMS".)) "" OPERATOR_GROUP ".
'OPERATOR_GROUP' WHERE ' OPERATOR_ID "=" LIMS$ OPERATOR_ID "() AND"GROUP_ID "=:B4)))".
3 - access ("U_ABS_DETERMINATION" ="DETERMINATION_ASSIGNMENT")
5 - access("PLT".") PLATE_ID"(+) ="PLATE_ID")
6 - access ("TEST_ID" ="TEST_ID")
7 - access ("ALIQUOT_ID" ="ALIQUOT_ID")
8 - access ("ALIQUOT_ID" ="ALIQUOT_ID")
9 - filter("STATUS"='C' OR "STATUS"='P' OR "STATUS"='V')
11 - access ("SAMPLE_ID" ="SAMPLE_ID")
15 - filter ("U_ABS_DETERMINATION" IS NOT NULL AND "U_CLIENT_TYPE" = 'QC' AND
"U_WEEK_OF_PROCESSING"= TO_NUMBER(:WEEK) AND "U_YEAR_OF_SAMPLE_DELIVERY' = TO_NUMBER (:YEAR)).
17 - access ("SDG_ID" ="SDG_ID")
18 - access ("SDG_ID" ="SDG_ID")
20 - access ("SAMPLE_ID" ="SAMPLE_ID")
23 - filter ('NAME' = 'End result')
25 - filter("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS".")) OPERATOR_GROUP ".
'OPERATOR_GROUP' WHERE ' OPERATOR_ID "=" LIMS$ OPERATOR_ID "() AND"GROUP_ID "=:B1))".
27 - access ("GROUP_ID" =: B1 AND "OPERATOR_ID"="LIMS$ OPERATOR_ID" ())
28 - access ("GROUP_ID" =: B1 AND "OPERATOR_ID"="LIMS$ OPERATOR_ID" ())
29 - access ("GROUP_ID" =: B1 AND "OPERATOR_ID"="LIMS$ OPERATOR_ID" ())
30 - access ("GROUP_ID" =: B1 AND "OPERATOR_ID"="LIMS$ OPERATOR_ID" ())
31 - access ("GROUP_ID" =: B1 AND "OPERATOR_ID"="LIMS$ OPERATOR_ID" ())

Note
-----
-"PLAN_TABLE' is old version
{code}


* tkprof 1 *.
{code}

TKPROF: Release 10.2.0.3.0 - Production on Tue Jan 13 13:21:47 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_880.trc
Sorting options: by default

********************************************************************************
Count = number of times OIC procedure has been executed
CPU = time in seconds cpu execution
elapsed = elapsed time in seconds the execution
disc = number of physical reads from disk buffers
Query = number of buffers for a consistent reading
current = number of buffers in current mode (usually for the update)
rows = number of rows processed by extracting or execute the call
********************************************************************************

SELECT sdu.u_crop_group,
SD. Name as sdg_name,
ad.variety_name,
ad.batch_number,
B.SID as aliquot_name,
Sau.u_box_code as box_code,
Sau.u_box_position as box_position,
t.Nom as test_name,
r.original_result,
PLT. Name as plate_name,
Concat (chr (a.plate_row + 64), a.plate_column) as plate_position,
au.u_replicate_number as replicate_number
OF lims_sys.sdg sd,.
lims_sys.sdg_user STO,
lims_sys. Sample his.
lims_sys.sample_user sau,
lims_sys.aliquot has,
to the lims_sys.aliquot_user,.
lims_sys.test t,
lims_sys. Result r,
PLT lims_sys.plate,
Ad lims_sys.abs_determination
WHERE sd.sdg_id = sdu.sdg_id
AND sd.sdg_id = sa.sdg_id
AND sa.sample_id = sau.sample_id
AND sau.sample_id = a.sample_id
AND a.aliquot_id = au.aliquot_id
AND au.aliquot_id = t.aliquot_id
AND t.test_id = r.test_id
AND plt.plate_id (+) = a.plate_id
AND sdu.u_abs_determination = ad.determination_assignment
AND a.status IN ('V', 'P', 'C')
AND r.name = 'result '.
AND sdu.u_client_type = "QC".
AND sdu.u_year_of_sample_delivery = (: year)
AND sdu.u_week_of_processing = (: week)
- AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)
ORDER BY box_code, box_position, replicate_number

call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Run 1 1.15 1.16 0 0 0 0
Fetch 1 8.53 16.10 227649 241266 0 500
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 3 9.68 17,27 227649 241266 0 500

Chess in the library during parsing cache: 1
Lack in the library during execution cache: 1
Optimizer mode: ALL_ROWS
The analysis of the user id: 97

Rows Row Source operation
------- ---------------------------------------------------
SORT ORDER BY 500 (cr = 241266 pr = 227649 pw = time 0 = 16104631 en)
FILTER 21311 (cr = 241266 pr = 227649 pw = time 0 = 16246749 en)
21311 HASH JOIN (cr = 241266 pr = 227649 pw = time 0 = 16225434 en)
17745 TABLE ACCESS FULL DWH_ABS_DETERMINATION (cr = 374 pr = 0 pw = time 0 = 69 fr)
21311 HASH JOIN RIGHT OUTER (cr = 240892 pr = 227649 pw = time 0 = 16170607 en)
21895 VIEW PLATE (cr = 316 pr = 0 pw = time 0 = 43825 US)
21895 FILTER (cr = 316 pr = 0 pw = time 0 = 43823 US)
21895 TRAY FULL ACCESS (cr = 316 pr = 0 pw = time 0 = 31 US)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr = 0 pr = 0 pw = time 0 = 0 US)(object id 45769)
21311 HASH JOIN (cr = 240576 pr = 227649 pw = time 0 = 16106174 en)
21311 HASH JOIN (cr = 133559 pr 121596 pw = time = 0 = 9594130 en)
21311 HASH JOIN (cr = 94323 pr = 83281 pw = time 0 = 6917067 en)
21311 HASH JOIN (cr = 86383 pr 75547 pw = time = 0 = 5509672 en)
JOIN by HASH 7776 (cr = 8134 pr = 0 pw = time 0 = 285364 en)
TABLE ACCESS BY INDEX ROWID SAMPLE 7776 (cr = 572 pr = 0 pw = time 0 = 27152 US)
7876 NESTED LOOPS (cr = 377 pr = 0 pw = time 0 = 488287 en)
JOIN by HASH 99 (cr = 160 pr = 0 pw = time 0 = US 4168)
99 TABLE ACCESS FULL SDG_USER (cr = 53 pr = 0 pw = time 0 = US 1209)
5719 TABLE ACCESS FULL SDG (cr = 107 pr = 0 pw = time 0 = 17 US)
7776 INDEX RANGE SCAN FK_SAMPLE_SDG (cr = 217 pr = 0 pw = time 0 = 623 en)(object id 45990)
1079741 TABLE ACCESS FULL SAMPLE_USER (cr = 7562 pr = 0 pw = time 0 = 24 US)
3307948 TABLE ALIQUOT FULL ACCESS (cr = 78249 pr = pw 75547 time = 0 = 3331129 en)
3406836 TABLE ACCESS FULL ALIQUOT_USER (cr = 7940 pr 7734 pw = time = 0 = 556 en)
3406832 TABLE TEST FULL ACCESS (cr = 39236 pr 38315 pw = time = 0 = 3413192 en)
3406832 TABLE ACCESS FULL RESULTS (cr = 107017 pr = 106053 pw = time 0 = 6848487 en)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr = 0 pr = 0 pw = time 0 = 0 US)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr = 0 pr = 0 pw = time 0 = 0 US)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr = 0 pr = 0 pw = time 0 = 0 US)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr = 0 pr = 0 pw = time 0 = 0 US)(object id 45769)

********************************************************************************

Select 'x '.
Of
Double


call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Run 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 0 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 3 0.00 0.00 0 0 0 1

Chess in the library during parsing cache: 0
Optimizer mode: ALL_ROWS
The analysis of the user id: 97

Rows Row Source operation
------- ---------------------------------------------------
1 DOUBLE QUICK (cr = 0 pr = 0 pw = time 0 = 3 US)

********************************************************************************

Start: id: = sys.dbms_transaction.local_transaction_id; end;


call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Run 1 0.00 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 2 0.00 0.00 0 0 0 1

Chess in the library during parsing cache: 0
Optimizer mode: ALL_ROWS
The analysis of the user id: 97



********************************************************************************

TOTALS FOR ALL NON RECURSIVE INSTRUCTIONS

call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 3 0.00 0.00 0 0 0 0
Run 3 1.15 1.16 0 0 0 1
Pick 2 8.53 16.10 227649 241266 0 501
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 8 9.68 17,27 227649 241266 0 502

Chess in the library during parsing cache: 1
Lack in the library during execution cache: 1


TOTALS FOR ALL RECURSIVE INSTRUCTIONS

call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 30 0.00 0.00 0 0 0 0
Run 30 0.00 0.00 0 0 0 0
Get 30 0.00 0.00 0 40 0 10
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 90 0.00 0.00 0 40 0 10

Chess in the library during parsing cache: 0

3 the session user SQL statements.
30 internal to SQL statements in session.
33 SQL statements in session.
********************************************************************************
Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_880.trc
Compatibility of trace files: 10.01.00
Sorting options: by default

8 sessions in the trace file.
3 SQL statements of the user in the trace file.
30 internal SQL instructions in the trace file.
33 SQL statements in the trace file.
6 unique SQL statements in the trace file.
633 lines in the trace file.
23 seconds in the trace file.
{code}

ZI wrote:
I have a statement with a decoding function in the where clause like this:

AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)

When I have a package-1 as parameter for cropgroup the filter would result by ' AND '-1' = '-1', and the statement is executed in less than 2 seconds.»»» When I leave this where clause it takes almost 18 seconds. The result is the same so I don't understand why the explain plan command is so different and why not use index scans in the statement without decoding.

I would interpret the results displayed differently.

Execution which took 17 s according to the 241 266 coherent block played tkprof output gets but in order to do so he read 227 649 the disk blocks. Note that most of the table addressed by this query blocks were read through scanning of complete table that can take advantage of multiple blocks readings, for example if you unset the db_file_multiblock_read_count 10.2 (recommended) it usually try to read 1 MB with a read request, which are 128 blocks in case of standard block size 8 k. Due to several reasons not always the full size can be requested with each read request, lets say about 200 000 blocks could have been read by about 2,000 blocks multiple readings. Each read request would turn into a physical read, could you get an estimate approximate 25 MS per read times 2,000 applications-online 50 seconds (your system is running obviously better that the average assumed by ost g 10 base optimizer without collected statistics system workload, can be that some additional file caching system is involved).

On the other hand, the execution plan that finished within 2 seconds completed 221 420 coherent block gets but did No physical reads at all. Note that most of the table blocks should be processed using one-piece random searches (ACCESS BY ROWID of the TABLE), according to the grouping of the indices factor, it could have been as many blocks that the lines have been returned to the range index scans. So you could have done with lets say more than 60,000 randomly accessed table blocks => until 60 000 monobloc required reading. So in the worst case, this may take 60 000 requests time 10ms by read-online 600 seconds, even if in reality at least some of the blocks will be stored in the buffer cache, so it should be less.

It would be interesting to know how these two declarations with a cold buffer cache, so that both had to physical reads. I suppose the first is actually faster. Of course, if the second corresponds more to your typical situation that most of the blocks is in the buffer anyway, then it could be faster, because the blocks read by random access are more likely to stay in memory blocks read by complete sweep of the table, but in a true perspective of I/O the first is expected to be higher.

Moreover, the change in the plan is probably caused by the fact that the additional predicate (DECODING) lowers the cardinality of the table of SDG_USER conduct so that LOOP IMBRIQUEE approach seems to be cheaper to the optimizer that the hash join/full scan table approach. Apparently the estimate is way off (by two orders of magnitude, in fact 100 instead of 1), then the plan is not really cheap, because it seems like the optimizer.

By the way: two actual execution plans displayed in the output from tkprof are actually different from the displayed output of EXPLAIN the PLAN, so the statement has executed a little differently provided the facility to EXPLAIN the PLAN.

Your PLAN_TABLE is old, since you are on 10g you should drop any PLAN_TABLEs that are in non - SYS diagrams, since 10 g already provides a global temporary Table as part of the default dictionary (SYS. Plan_table$ presentations via public synonym PLAN_TABLE).

Kind regards
Randolf

Oracle related blog stuff:
http://Oracle-Randolf.blogspot.com/

SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/

Tags: Database

Similar Questions

  • How can I change the work plan

    How can I change the work plan

    Can you explain more? What is changing? You can use the move tool V to move the artboard, it is the tool of workplan under the move tool, which can change the size of the artboard. Move the tool will move back if you try to move a work plan or if you try to change its size.

  • 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

  • Your power plan information are not available. Access is denied. Not able to change the power plan options.

    Original title: why I can't change the options for when I close the lid of my portable computer?

    When I go to power options and change what happens when I close the lid, I click on change settings that are currently unavailable and it says "your power plan information are not available. Access is denied"and I can't change my options. I tried these two options:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-performance/your-power-plan-information-isn ' t-available-cant/b39cfd71-2455-4400-83de-018ce7a18eef

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-performance/error-your-power-plan-information-is-not-available/c32eba7b-3428-46FE-AFC5-0c3369d1ca8e

    but none seemed to work. Could someone please help.

    Dan

    If you're on a Samsung or Sony [he possibly also others], then there is a 'useful' utility, installed by the PC manufacturer that is inhibiting your ability to set power plans.  Quick start to type in the search box of the start menu & if such a utility exists then go ahead & turn it off - there is no unwanted side effects.  It doesn't help that you can't do yourself.

    For the other PC, navigate to the folder of the machine in all programs and search for any similar name - quick start, fast, mess-up-your-power sleep - options.exe, that sort of thing.

    Because the symptoms for the first time by people with this afliction is always - can't change what happens when I change the cover - I think you'll be right as rain when you have disabled the quick start.

    Let me know how you go,

    {I would say, 'Good luck', but you won't need luck.}

  • Can I change the annual plan of photoshop for all users?

    A few days ago, I joined the annual plan member ship, using photoshop and lightroom.

    But I need InDesign. Then I can be changed to all the user not separately?

    You can add only InDesign to your membership for $20 (U.S. price) or go to the total subscription

    Single update for all http://forums.adobe.com/thread/1235382 clouds can help

  • Change the training Plan?

    I don't see a place to change a learning plan once it was created, is it not possible? I created one to add in some way to a person when they are added to a certain group and did not want to specify a time period for completion (it's learning during the first). Now it's show days '0' to finish. Opens forever or never opened it's just what it means? Sounds weird, I know. Also, you can add several courses/activities for a training PLAN? I guess it's a PLAN that you might...

    Thank you.

    Hi Wendy,.

    My apologies for the error of reading it.

    You cannot change once created learning plans. However, you can disable. Also you can only add a course or learning or a program of Certification for a Learning Plan.

    Even if you have set '0' to complete then also learning day will be able to take LP any time thereafter, and it will be shown in the dashboard. You can also set a deadline for this LP to make sure that the user takes the Learning Plan.

    Kind regards

    MILIN

  • Interpret the Explain Plan command

    Hi guys,.

    I traced the command explain for a query plan and the plan is as below.

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

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

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

    |   0 | SELECT STATEMENT |                      |     1.  1482 |    12 (17) | 00:00:01 |

    |   1.  SORT ORDER BY |                      |     1.  1482 |    12 (17) | 00:00:01 |

    |   2.   UNIQUE HASH |                      |     1.  1482 |    11 (10) | 00:00:01 |

    |   3.    NESTED EXTERNAL LOOPS |                      |    44. 65208 |    10 (0) | 00:00:01 |

    |   4.     NESTED EXTERNAL LOOPS |                      |     2.  2952 |     8 (0) | 00:00:01 |

    |   5.      NESTED EXTERNAL LOOPS |                      |     2.  2940.     7 (0) | 00:00:01 |

    |   6.       NESTED EXTERNAL LOOPS |                      |     1.  1458 |     6 (0). 00:00:01 |

    |   8 S        NESTED EXTERNAL LOOPS |                      |     1.  1419.     5 (0) | 00:00:01 |

    |   8.         NESTED EXTERNAL LOOPS |                      |     1.  1331.     4 (0) | 00:00:01 |

    |   9.          NESTED EXTERNAL LOOPS |                      |     1.  1266.     3 (0) | 00:00:01 |

    |  10.           NESTED EXTERNAL LOOPS |                      |     1.  1250 |     2 (0) | 00:00:01 |

    | * 11 |            TABLE ACCESS BY INDEX ROWID | PERSPECTIVE |     1.  1236.     1 (0) | 00:00:01 |

    | * 12 |             INDEX RANGE SCAN | I08_PROSPECT |     1.       |     1 (0) | 00:00:01 |

    |  13.            TABLE ACCESS BY INDEX ROWID | REGION |     1.    14.     1 (0) | 00:00:01 |

    | * 14 |             INDEX RANGE SCAN | PK_REGION |     1.       |     1 (0) | 00:00:01 |

    |  15.           TABLE ACCESS BY INDEX ROWID | BANK                 |     1.    16.     1 (0) | 00:00:01 |

    | * 16.            INDEX UNIQUE SCAN | PK_BANK |     1.       |     1 (0) | 00:00:01 |

    |  17.          TABLE ACCESS BY INDEX ROWID | USERS |     1.    65.     1 (0) | 00:00:01 |

    | * 18.           INDEX UNIQUE SCAN | PK_USERS |     1.       |     1 (0) | 00:00:01 |

    |  19.         TABLE ACCESS BY INDEX ROWID | PROSPECT_ADDRESS |     1.    88.     1 (0) | 00:00:01 |

    | * 20.          INDEX RANGE SCAN | I02_PROSPECT_ADDRESS |     1.       |     1 (0) | 00:00:01 |

    | * 21.        TABLE ACCESS BY INDEX ROWID | SUBSCRIPTION_TYPE |     1.    39.     1 (0) | 00:00:01 |

    | * 22.         INDEX UNIQUE SCAN | PK_ADDRESS_TYPE |     1.       |     1 (0) | 00:00:01 |

    |  23.       TABLE ACCESS BY INDEX ROWID | REFERENCE |     2.    24.     1 (0) | 00:00:01 |

    | * 24.        INDEX RANGE SCAN | U01_REFERRAL |     2.       |     1 (0) | 00:00:01 |

    | * 25.      INDEX UNIQUE SCAN | PK_LOCATION_CODES |     1.     6.     1 (0) | 00:00:01 |

    | * 26.     INDEX SCAN FULL | U01_USER_LOCATION |    23.   138.     1 (0) | 00:00:01 |

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

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

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

    11 - filter("TPPRO1".") IS_DELETED' IS NULL OR "TPPRO1". "IS_DELETED"= U 'N')

    12 - access("TPPRO1".") CUSTOMER_ID "= U '000900000000000000000000122202')

    14 - access("TPREG1".") REGION_ID' (+) = "TPPRO1". ("' REGION_ID")

    16 - access("TPBA1".") BANK_ID' (+) = "TPPRO1". ("' BANK_ID")

    18 - access("TPUS21".") USER_ID' (+) = "TPPRO1". ("' CREATED_BY ')

    20 - access("TPPRO1".") PROSPECT_ID "= 'TPPRAD1'." PROSPECT_ID "(+))"

    21 - filter("TPADTY1".") ADDR_TYPE_NAME "(+) = U 'Primary')

    22 - access("TPPRAD1".") ADDR_TYPE_ID "= 'TPADTY1'." ADDR_TYPE_ID "(+))"

    24 - access("TPRE1".") PROSPECT_ID' (+) = "TPPRO1". ("' PROSPECT_ID")

    25 - access("TPLOCO1".") LOCATION_CODE_ID' (+) = "TPRE1". ("' LOCATION_LIMIT")

    26 - access("TPLOCO1".") LOCATION_CODE_ID "= 'TPUSLO1'." LOCATION_CODE_ID "(+))"

    filter ("TPLOCO1". "LOCATION_CODE_ID"= 'TPUSLO1'." LOCATION_CODE_ID "(+))"

    So while interpreting, I can understand the first step is 12 and the second stage is 14, but there is no relationship between step 12 and 14.

    Here's the sql code

    SELECT

    SEPARATE

    TPPRO1. PROSPECT_ID,

    TPPRO1. PROS_NAME,

    TPPRO1.NET_ADDRESS,

    TPPRO1. DAY_PHONE,

    TPPRO1. NIGHT_PHONE,

    TPPRO1. CONTACT_LOW,

    TPPRO1. CONTACT_HIGH,

    TPPRO1. CREATED_BY,

    TPPRO1. CUSTOMER_ID,

    TPPRO1. CUSTOMER_TYPE,

    TPPRO1. ACCOUNT_NUMBER,

    TPPRO1. MCIF_NUMBER,

    TPPRO1.IS_CUSTOMER,

    TPPRO1. BEST_DAY_TO_CALL,

    TPPRO1. DEFAULT_PRIORITY,

    TPPRO1. PROSPECT_STATUS,

    TPPRO1. FAX_NUMBER,

    TPPRO1.IS_BUSINESS,

    TPPRO1. BANK_ID,

    TPPRO1. REGION_ID,

    TPPRO1. BIRTH_DATE,

    TPPRO1. PRIMARY_LANGUAGE,

    TPPRO1. IDENTIFICATION_NUMBER,

    TPPRO1. EMPLOYER_NAME,

    TPPRO1. FUNCTION,

    TPPRO1. DATE_EMPLOYED,

    TPPRO1. EMPLOYEE_COUNT,

    TPPRO1. NUMBER_OF_LOCATIONS,

    TPPRO1. ESTABLISHED_DATE,

    TPPRO1. INDUSTRY_TYPE,

    TPPRO1. PRIMARY_CONTACT,

    TPPRO1. TIN,

    TPPRO1. FOREIGN_TAX_ID,

    TPPRO1. DATE_CHANGED,

    TPPRO1. RELATIONSHIP_MGR,

    TPPRO1. RELATIONSHIP_MGR_NAME RELATIONSHIP_MGR_USER_NAME,

    TPPRO1. LAST_NA_DONE,

    TPPRO1. TTL_ASSETS,

    TPPRO1. TTL_LIABILITIES,

    TPPRO1. PROFITABILITY_IND,

    TPPRO1. MARITAL_STATUS,

    TPPRO1. GREETING,

    TPPRO1. SIC_CODE,

    TPPRO1. STOCK_SYMBOL,

    TPPRO1. STOCK_EXCHANGE,

    TPPRO1. CURRENCY_TYPE,

    TPPRO1. PHRASE_TYPE,

    TPPRO1. PHRASE_VALUE,

    TPPRO1. EMPLOYEE_TYPE,

    TPPRO1. BUSINESS_TYPE,

    TPPRO1. CERTIFICATION,

    TPPRO1. GENDER,

    TPPRO1. ANNUAL_INCOME,

    TPPRO1.ID_TYPE,

    TPPRO1.ID_LOCATION,

    TPPRO1. PRIMARY_RESIDENCE,

    TPPRO1. RESIDENCE_DATE,

    TPPRO1. CUSTOMER_SINCE,

    TPPRO1. PRIMARY_BRANCH,

    TPPRO1. SERVICE_LEVEL_ID,

    TPPRO1. SERVICE_LEVEL_DESCRIPTION,

    TPPRO1. DO_NOT_SHARE,

    TPUS21. USER_NAME,

    TPUS21. FIRST NAME,

    TPUS21. MIDDLE_INITIAL,

    TPUS21. LAST_NAME,

    TPBA1. BANK_CODE,

    TPREG1. REGION_CODE,

    TPPRO1.IS_QUALIFIED,

    TPPRO1. QUALIFIED_TRACKING_NBR,

    TPPRO1. QUALIFIED_DEBIT_LIMIT,

    TPPRO1. QUALIFIED_LOC_LIMIT,

    TPPRO1. QUALIFIED_CARD,

    TPPRO1. QUALIFIED_DATE,

    TPPRO1. QUALIFIED_BY,

    TPPRO1. QUALIFIED_BY_NAME,

    TPPRO1. DAILY_LIMIT,

    TPPRO1. LINE_OF_CREDIT,

    TPPRO1. HOUSEHOLD_ID,

    TPPRO1. MARKET_SEGMENT,

    TPPRO1. CREDIT_TOLERANCE,

    TPPRO1. RISK_TOLERANCE,

    TPPRO1. CREDIT_RATING,

    TPPRO1. CREDIT_RATING_DATE,

    TPPRO1. WEBSITE_ADDRESS,

    TPPRO1. HOME_VALUE,

    TPPRO1. CENSUS_TRACT,

    TPPRO1. HOUSEHOLD_COUNT,

    TPPRO1. DUNS_NUMBER,

    TPPRO1. QUALIFIED_LENDING_DATE,

    TPPRO1. HOUSEHOLD_POSITION,

    TPPRO1. FS_REVIEW_DATE,

    TPPRO1. FISCAL_YEAR_END,

    TPPRO1. FS_DATE,

    TPPRO1. GRADE_DESCRIPTION,

    TPPRO1. HOME_OWNER_FLAG,

    TPPRO1.COMMERCIAL_RATING,

    TPPRO1. NAIC_RATING,

    TPPRO1. LTD_RATING_MOODY,

    TPPRO1. LTD_RATING_DUN,

    TPPRO1. LTD_RATING_SP,

    TPPRO1. INC_STATE,

    TPPRO1. POSITIVE_CREDIT_RPT,

    TPPRO1. ULTIMATE_DUNS,

    TPPRO1. PARENT_DUNS,

    TPPRO1. SECOND_SIC_CODE,

    TPPRO1. THIRD_SIC_CODE,

    TPPRO1. CUSTOMER_SEGMENT,

    TPPRO1. RELATIONSHIP_MGR_NAME2,

    TPPRO1. DEBT_WORTH_RATIO,

    TPPRO1. CASH_FLOW,

    TPPRO1. DEBT_SERVICE,

    TPPRO1. DEBT_INCOME_RATIO,

    TPPRO1.NET_WORTH,

    TPPRO1. FS_RPT_FREQUENCY,

    TPPRO1. SHAREHOLDERS_QUANTITY,

    TPPRO1. FS_LAG_TIME,

    TPPRO1. ULT_RELATIONSHIP_MGR,

    TPPRO1. CORP_TAX_RATE,

    TPPRO1. RISK_GRADE,

    TPPRO1. ULT_PROSPECT_ID,

    TPPRO1. PARENT_PROSPECT_ID,

    TPPRO1. EARNINGS_CREDIT_RATE,

    TPPRO1. First name assignedUserFirstName,

    TPPRO1. AssignedUserLastName last_name,

    TPPRO1. MIDDLE_NAME assignedMiddleUser,

    TPPRO1. SUFFIX,

    TPPRO1. PREFIX,

    TPPRO1. ULT_RELATIONSHIP_MGR_NAME,

    TPPRO1. ANNUAL_INCOME_CCODE,

    TPPRO1. CASH_FLOW_CCODE,

    TPPRO1.NET_WORTH_CCODE,

    TPPRO1. TTL_ASSETS_CCODE,

    TPPRO1. TTL_LIABILITIES_CCODE,

    TPPRO1. QUALIFIED_DEBIT_LIMIT_CCODE,

    TPPRO1. QUALIFIED_LOC_LIMIT_CCODE,

    TPPRO1. DAILY_LIMIT_CCODE,

    TPPRO1. LINE_OF_CREDIT_CCODE,

    TPPRO1. HOME_VALUE_CCODE,

    TPPRO1. ACCT_TYPE,

    TPPRO1. BUSINESS_STATE,

    TPPRO1. BUSINESS_COUNTY,

    TPPRO1.IS_FAX_ACCEPTED,

    TPPRO1.IS_OWNER,

    TPPRO1.IS_OFFICER,

    TPPRO1. LAST_CONTACT_DATE,

    TPPRO1. CITIZENSHIP_COUNTRY,

    TPPRO1. OCCUPATION,

    TPPRO1. LEGAL_DESIGNATION,

    TPPRO1. BUSINESS_NATURE,

    TPPRO1. INDUSTRY_TYPE_CODE,

    TPPRO1. INDUSTRY_TYPE_CODE_DESC,

    TPPRO1. PRIMARY_DATE_ISSUED,

    TPPRO1. PRIMARY_DATE_EXPIRED,

    TPPRO1. PRIMARY_ID_OTHER_INFO,

    TPPRO1. SEC_ID_OTHER_INFO,

    TPPRO1. QUALIFIED_LOC_LIMIT_CCODE,

    TPPRO1. SEC_ID_TYPE,

    TPPRO1. SEC_ID_LOCATION,

    TPPRO1. SEC_ID_NUMBER,

    TPPRO1. SEC_DATE_ISSUED,

    TPPRO1. SEC_DATE_EXPIRED,

    TPPRO1. THD_ID_TYPE,

    TPPRO1. THD_ID_LOCATION,

    TPPRO1. THD_ID_NUMBER,

    TPPRO1. THD_DATE_EXPIRED,

    TPPRO1. THD_DATE_ISSUED,

    TPPRO1. TIN_TYPE,

    TPPRO1.IS_VERIFIED,

    TPPRO1. VERIFIED_BY,

    TPPRO1. VERIFIED_BY_NAME,

    TPPRO1. VERIFIED_DATE,

    TPPRO1. QUALIFY_STRATEGY_TYPE,

    TPPRO1. INC_COUNTRY,

    TPPRO1. COUNTRY_OF_PRINCI_OFF,

    TPPRO1. OED_INSTITUTION,

    TPPRO1. VERIFY_FAILED_REASON,

    TPPRO1. QUALIFY_TYPE,

    TPPRAD1. CITY,

    TPPRAD1. ADDRESS_LINE1,

    TPPRAD1. ADDRESS_LINE2,

    TPPRAD1. ADDRESS_LINE3,

    TPPRAD1. ADDRESS_LINE4,

    TPPRAD1. STATE_PROVINCE,

    TPPRAD1. ZIP_CODE,

    TPPRAD1. COUNTRIES,

    TPPRAD1.IS_DOMESTIC,

    TPADTY1. ADDR_TYPE_ID,

    TPADTY1. ADDR_TYPE_NAME,

    TPADTY1. ADDR_TYPE_DESC,

    TPPRO1. VERIFY_FAILED_REASON,

    TPPRO1. QUALIFY_TYPE

    Of

    PERSPECTIVE TPPRO1

    LEFT OUTER JOIN

    PROSPECT_ADDRESS TPPRAD1

    ON TPPRO1. PROSPECT_ID = TPPRAD1. PROSPECT_ID

    LEFT OUTER JOIN

    SUBSCRIPTION_TYPE TPADTY1

    WE

    (Tpprad1.Addr_Type_Id = Tpadty1.Addr_Type_Id) And

    (TPADTY1. ADDR_TYPE_NAME = "Primary")

    LEFT OUTER JOIN

    USERS TPUS21

    ON TPUS21. USER_ID = TPPRO1. CREATED_BY

    LEFT OUTER JOIN

    REFERENCE TPRE1

    ON TPRE1. PROSPECT_ID = TPPRO1. PROSPECT_ID

    LEFT OUTER JOIN

    LOCATION_CODES TPLOCO1

    ON TPLOCO1. LOCATION_CODE_ID = TPRE1. LOCATION_LIMIT

    LEFT OUTER JOIN

    USER_LOCATION TPUSLO1

    ON TPLOCO1. LOCATION_CODE_ID = TPUSLO1. LOCATION_CODE_ID

    LEFT OUTER JOIN

    BANK TPBA1

    ON TPBA1. BANK_ID = TPPRO1. BANK_ID

    LEFT OUTER JOIN

    TPREG1 REGION

    ON TPREG1. REGION_ID = TPPRO1. REGION_ID

    Where

    ((TPPRO1.IS_DELETED = ' N ') OR)

    (((Tppro1.Is_Deleted) is nothing)) And

    AND (TPPRO1. CUSTOMER_ID = '000900000000000000000000122202')

    ORDER OF TPPRO1. PROSPECT_ID;

    Can someone explain to me the steps of the execution plan.

    Please share thoughts and ideas.

    Kind regards

    Ranjan

    Hello Rodriguez

    There is no problem with this execution plan:

    The order of execution is as follows - grouped by NL for you that you can see how it is run.

    NL (1): 12, 11, 10, 13, 14

    NL (2): 16, 15, 9

    NL (3): 18, 17: 8

    NL (4): 20, 19: 7

    NL (5): 22, 21: 6

    NL (6): 24, 23, 5

    NL (7): 25, 4

    NL (8): 26, 3

    2, 1, 0

    Unique hash = to SEPARATE sorting algorithm (it's a performanter we of the (Unique) fate)

    I hope that helps!

  • Cannot change the CC plan

    Hello

    We license team CC and unique apps: 2xPS, 2xAi, 1xId and 1xLr (but not CC - 5, upgrade to CC).

    I try to change from single-app in plan membership plan complete but still message: 'we cannot change your plans at this time... ". "But Adobe systems is in charge my credit card for 1 Eur for each tent.

    Can you help me solve this problem? Thank you in advance.

    Adobe.jpg

    Hi Vytaute,

    Please contact support:

    Contact the customer service

    Concerning

    Megha Rawat

  • How to change the execution plan

    I've simplified queries in order to clarify the issue.
    The Boolean condition (true or false) is a criterion which has been initialized or not.
    In one case, if it is true, I want to get all the ID of the table.
    If not, I want to get only the corresponding line (pk_id = 1)

    Select pk_id
    s table
    where (1 = 0) or EXISTS (select 1 from table ss where ss.pk_id = s.pk_id and ss.pk_id = 1);

    In my case, a comprehensive analysis that's happened in any case. (TRUE or FALSE)

    If I remove the Boolean condition, oracle optimizer transforms the query and it uses a single INDEX scan.
    Select pk_id
    s table
    where EXISTS (select 1 from table ss where ss.pk_id = s.pk_id and ss.pk_id = 1);

    I have performed this request in other databases, but it works well on my system.

    Hello

    If's table' and 'table ss' are the same, see another answer. If they are different (which I assume), then the query reads:

    retrieve all PK_IDs from mytable if the constant condition is true, or recover the only one with a value of 1 if it exists in the table mytable AND if there is also in the other myothertable of the table.

    Then I would move the condition pk_id = 1 outside EXISTS (and I put it also on the inside to make the life of the optimizer):

    SELECT pk_id

    S MYTABLE

    WHERE 1 = 0

    OR s.pk_id = 1

    AND EXISTS (SELECT NULL

    OF myothertable ss

    WHERE ss.pk_id = 1

    )

    ;

    Note: 'AND' is evaluated before 'OR' as ' * ' is evaluated before '+', so no parentheses not necessary: has or b AND c equals an OR (b AND c) operation as a + b * c means a + (b * c).

    Best regards

    Bruno Vroman.

  • 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...

  • Numbering plan of TMS actions required when changing the VCS

    Hi all

    I will be changing my exclusively H323 to SIP client only VCS dial plan. This will be done to activate the route through VCS - E and also prepare for the migration of their VC on CUCM endpoints at a later date. When I change the dial plan I'll change the end point URIs, aka Multiway and digital beaches assigned to scheduled meetings.

    Can you please help me understand what I need to do to make sure that:

    1. MSD directories are updated with new endpoint aliases; and
    2. Existing meetings are moved to the new number ranges

    Thanks in advance for your advice.

    Telephone directories TMS should update automatically as long as they do not use a source directory manually.  You should see the telephone directory changes some time after you migrate the H323 to SIP endpoints points, depending on how often you have telephone directories to update.

    A regular conference will have to be updated to reflect the change dial plan, you can simply change the Protocol that uses H323 to SIP endpoint in the settings to connect to the Conference.

  • I have the following plan to explain, but I don't know how interperent it

    Hello all;

    I have the explain plan following below obtained pl/sql developer, but I don't know how to interperent or use it for my performance problem
    PLAN_TABLE_OUTPUT          
               
    ----------------------------------------------------------------------------------------          
    | Id  | Operation                       |  Name                | Rows  | Bytes | Cost  |          
    ----------------------------------------------------------------------------------------          
    |   0 | SELECT STATEMENT                |                      |     1 |   108 |   932 |          
    |   1 |  SORT GROUP BY                  |                      |     1 |   108 |   932 |          
    |*  2 |   TABLE ACCESS BY INDEX ROWID   | OPERATION            |     1 |    34 |    12 |          
    |   3 |    NESTED LOOPS                 |                      |     1 |   108 |   929 |          
    |   4 |     NESTED LOOPS                |                      |     1 |    74 |   917 |          
    |*  5 |      HASH JOIN                  |                      |     1 |    60 |   916 |          
    |*  6 |       TABLE ACCESS FULL         | WORK_ORDER           |  1302 | 46872 |   787 |          
    |*  7 |       TABLE ACCESS FULL         | SERIALIZATION_TRACE  |   129K|  3044K|   123 |          
    |*  8 |      TABLE ACCESS BY INDEX ROWID| PART                 |     1 |    14 |     1 |          
    |*  9 |       INDEX UNIQUE SCAN         | SYS_C004302          |     1 |       |       |          
    |* 10 |     INDEX RANGE SCAN            | RCLX_OPERATION_3     |     1 |       |    11 |          
    ----------------------------------------------------------------------------------------          
               
    Predicate Information (identified by operation id):          
    ---------------------------------------------------          
               
       2 - filter("O"."RESOURCE_ID" LIKE 'TEST%')          
       5 - access("W"."BASE_ID"="PT"."WORKORDER_BASE_ID" AND           
                  "W"."LOT_ID"="PT"."WORKORDER_LOT_ID" AND "W"."SPLIT_ID"="PT"."WORKORDER_SPLIT_ID" AND 
                  "W"."SUB_ID"="PT"."WORKORDER_SUB_ID")          
       6 - filter("W"."TYPE"='W' AND "W"."PART_ID" IS NOT NULL AND "W"."PART_ID"<>'RMA' AND           
                  "W"."PART_ID"<>'REWORK' AND "W"."CLOSE_DATE">=TO_DATE('2010-01-01 00:00:00',           
                  'yyyy-mm-dd hh24:mi:ss') AND "W"."CLOSE_DATE"<=TO_DATE('2010-12-31 00:00:00',           
                  'yyyy-mm-dd hh24:mi:ss'))          
       7 - filter("PT"."SERIAL_NUMBER"<>'N/A')          
       8 - filter("P"."PLANNER_USER_ID"='CCA')          
       9 - access("W"."PART_ID"="P"."ID")          
           filter("P"."ID"<>'RMA' AND "P"."ID"<>'REWORK')          
      10 - access("W"."SUB_ID"="O"."WORKORDER_SUB_ID" AND           
                  "W"."BASE_ID"="O"."WORKORDER_BASE_ID" AND "W"."LOT_ID"="O"."WORKORDER_LOT_ID" AND 
                  "W"."SPLIT_ID"="O"."WORKORDER_SPLIT_ID")          
           filter("W"."BASE_ID"="O"."WORKORDER_BASE_ID" AND           
                  "W"."LOT_ID"="O"."WORKORDER_LOT_ID" AND "W"."SPLIT_ID"="O"."WORKORDER_SPLIT_ID")     
               
    Note: cpu costing is off          
              

    Here are a few slides that I use when I present to you how to read explain plans:
    http://www.morganslibrary.org/Pres/lad/cloug_1_xplan.PDF

    |*  6 |        TABLE ACCESS FULL         | WORK_ORDER           |  1302 | 46872 |   787 |
    |*  7 |       TABLE ACCESS FULL         | SERIALIZATION_TRACE  |   129K|  3044K|   123 |
    

    Essentially, your question is here. you read a lot of lines to return alone. Do you need them all? To get them you do full table scan on the two tables? An index would help?

    and yes I am voluntarily is not giving you the answers but rather to point you in the right direction to find it yourself.

    On the one hand, I don't know your version, your SQL, or what indexes exist.

  • 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

  • Need to explain Plan output in HTML format

    Hello

    I have details slider sqlid and child. And I'm able to generate explain plan SQL running as below

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR('xxxxxxxxxxxxxx',0,'ALLSTATS'));

    I need send the output of this customer. and the problem is the customer wants in HTML format. Advice to reel in HTML format

    concerning

    Pravin

    You can always query the PLAN_TABLE directly, and use SQL * more to empty in HTML.

    Another option is to do this with SQL Developer. Paste the SQL statement into the worksheet, and then press the explain Plan. When you see the plan, right-click on it and choose export as HTML.

    See you soon,.
    Brian

Maybe you are looking for

  • How to get rid of AOL Homepage?

    Home/browser Firefox page has been hijacked by AOL; I tried firefox menu & computer program by default; and just updated to the latest firefox but who still have AOL.

  • Games indicates no link, but I can't access the Internet

    Original title: internet issues can connect via firefox, but my games say no link

  • Want to launch different Vi by clicking next to a Vi

    Hello I'm trying to make a user interface in which there are several VI. I want to do following things. 1. my first page when the user clicks on the exe should be page ID and password to login. 2. after login, a new screen should open to enter inform

  • Desktop HP 200-5120nl: new post and a question about the hp desktop pc

    I'm sorry, I already closed the last topic. I have too much to another link. I have download the drivers and software from hp also desktop. After you download windows 10 of course. It's a hp desktop pc. 200. 5120nl so if you would be kind enough to g

  • checkerboard of gradation

    I have a problem with setting the checkerboard of the attribute of gradation. I use 9 CVI and build my panels and controls programmatically. So I try juggling with the latest changes in CVI add this additional attribute to my routines that build all