A question about explain plan

here is my sql statement and running result:
SQL> @bind_variables_peeking_test.sql
SQL> SET ECHO OFF
SQL>
SQL> REM
SQL> REM Setup test environment
SQL> REM
SQL>
SQL> ALTER SYSTEM FLUSH SHARED_POOL;
SQL>
SQL> DROP TABLE t;
DROP TABLE t
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
SQL> CREATE TABLE t
2 AS
3 SELECT rownum AS id
4 FROM dual
5 CONNECT BY level <= 1000;
SQL>
SQL> execute dbms_stats.gather_table_stats(ownname=>user, tabname=>'t');
SQL> SELECT count(id), count(DISTINCT id), min(id), max(id) FROM t;
COUNT(ID) COUNT(DISTINCTID) MIN(ID) MAX(ID)
1000 1000 1 1000
SQL>
SQL> PAUSE
SQL>
SQL> REM
SQL> REM Without bind variables different execution plans are used if the value
SQL> REM used in the WHERE clause change. This is because the query optimizer
SQL> REM recognize the different selectivity of the two predicates.
SQL> REM
SQL>
SQL> SELECT count(*) FROM t WHERE id < 990;
COUNT(*)
989
SQL>
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL, 'typical'));
PLAN_TABLE_OUTPUT
SQL_ID bspfffaycy92u, child number 0
SELECT count(*) FROM t WHERE id < 990
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 3 (100)| |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 990 | 2970 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<990)
SQL>
SQL> PAUSE
SQL>
SQL> SELECT count(*) FROM t WHERE id < 10;
COUNT(*)
9
SQL>
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL, 'typical'));
PLAN_TABLE_OUTPUT
SQL_ID 4xfxt0frkj40y, child number 0
SELECT count(*) FROM t WHERE id < 10
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 3 (100)| |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 9 | 27 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<10)
SQL>
SQL> PAUSE
SQL>
SQL> REM
SQL> REM With bind variables the same execution plan is used. Depending on the
SQL> REM peeked value (10 or 990), a full table scan or an index range scan is used.
SQL> REM
SQL>
SQL> EXECUTE :id := 10;
SQL>
SQL> SELECT count(*) FROM t WHERE id < :id;
COUNT(*)
9
SQL>
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL, 'typical'));
PLAN_TABLE_OUTPUT
SQL_ID dkva59ypaxa6w, child number 0
SELECT count(*) FROM t WHERE id < :id
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 3 (100)| |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 9 | 27 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<:ID)
SQL>
SQL> PAUSE
SQL>
SQL> EXECUTE :id := 10;
SQL>
SQL> SELECT count(*) FROM t WHERE id < :id;
COUNT(*)
9
SQL>
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL, 'typical'));
PLAN_TABLE_OUTPUT
SQL_ID dkva59ypaxa6w, child number 0
SELECT count(*) FROM t WHERE id < :id
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 3 (100)| |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 9 | 27 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<:ID)
SQL>
SQL> PAUSE
SQL>
SQL> ALTER SYSTEM FLUSH SHARED_POOL;
SQL>
SQL> PAUSE
SQL>
SQL> EXECUTE :id := 10;
SQL> SELECT count(*) FROM t WHERE id < :id;
COUNT(*)
9
SQL> explain plan for SELECT count(*) FROM t WHERE id < :id;
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 3 | 3 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 50 | 150 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<TO_NUMBER(:ID))
SQL>
SQL> ALTER SYSTEM FLUSH SHARED_POOL;
SQL> PAUSE
SQL>
SQL> EXECUTE :id := 10;
SQL>
SQL> SELECT count(*) FROM t WHERE id < :id;
COUNT(*)
9
SQL>
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL, 'typical'));
PLAN_TABLE_OUTPUT
SQL_ID dkva59ypaxa6w, child number 0
SELECT count(*) FROM t WHERE id < :id
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 3 (100)| |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | TABLE ACCESS FULL| T | 9 | 27 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("ID"<:ID)
SQL>
SQL>
SQL> PAUSE
SQL>
SQL> REM
SQL> REM Cleanup
SQL> REM
SQL>
SQL> UNDEFINE sql_id
SQL>
SQL> DROP TABLE t;
SQL> PURGE TABLE t;
SQL>
SQL> spool off;
please noticed the last two explain plan result,one sql statement but have two result,why?

what do you mean "invalidated the previous plan"?
i gather the table statistics information once.
every time before i run the statement and explain plan, i flush share pool to make sure there are not execution plan to reused.
so i think i do not invalidated the previous plan and the two result should be same.

Similar Messages

  • Question about monthly plan

    For the $9.99 plan is there a minimum monthly committment?  Or is it pay by month and cancel anytime?

    Hello and thank you for your answer.  I do have one other question: with the createPDF subscription, can I create a pdf (from a Word document) that is text searchable and that recognizes the sequential numbering scheme in the pdf's page search field?
    Thank you in advance for your answer to this query,
    Zara
    Date: Fri, 13 Sep 2013 03:21:36 -0700
    From: [email protected]
    To: [email protected]
    Subject: Question about monthly plan
        Re: Question about monthly plan
        created by pranavj in Adobe CreatePDF - View the full discussion
    Hi Zwat,
    Thank you for your interest in ExportPDF subscription,
    To answer your question, Their is no commitment required for createPDF subscription, You can pay it on monthly basis and cancel it anytime you want. There is no extra cost involved to it.
    Let me know if you have any other queries.
    Regards,
    Pranav
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5678616#5678616
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5678616#5678616
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5678616#5678616. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe CreatePDF by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • About explain plan

    Hello ALL,
    I have the following explain plan, can any body explain the meaning of this explain plan
    SELECT * FROM
    2 TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE','111'));
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
    | 0 | SELECT STATEMENT | | 401 | 25263 | | 751K|
    | 1 | MERGE JOIN SEMI | | 401 | 25263 | | 751K|
    | 2 | SORT JOIN | | 17M| 820M| 2108M| 75297 |
    | 3 | TABLE ACCESS FULL | TABLE1 | 17M| 820M| | 3520 |
    |* 4 | SORT UNIQUE | | 275M| 3412M| 10G| 676K|
    | 5 | VIEW | VW_NSO_1 | 275M| 3412M| | 3538 |
    |* 6 | HASH JOIN | | 275M| 7874M| | 3538 |
    |* 7 | TABLE ACCESS FULL| TABLE2 | 16 | 128 | | 2 |
    |* 8 | TABLE ACCESS FULL| TABLE1 | 17M| 360M| | 3520 |
    Predicate Information (identified by operation id):
    4 - access("TABLE1"."POSITION"="VW_NSO_1"."$nso_col_1")
    filter("TABLE1"."POSITION"="VW_NSO_1"."$nso_col_1")
    6 - access("TABLE2"."VERSION_NO"="TABLE1"."VERSION_NO")
    7 - filter("TABLE2"."STATIC_UPD_FLAG"='N')
    8 - filter("TABLE1"."DATETIME_INSERTED">TO_DATE('0004-01-01 00:00:00',
    'yyyy-mm-dd hh24:mi:ss'))
    Note: cpu costing is off
    26 rows selected.
    SQL>

    There is a section in the manual on interpreting the output of explain plan http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/ex_plan.htm#16972 Tom Kyte also discusses interpreting the plan http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:231814117467#7344298017927 (page down about halfway where he starts his book excerpt).
    Rows, bytes, and temp space are the cost-based optimizer's guess about the number of rows, bytes, and temp space that will be touched (or consumed) by the operation. The cost is an internal number that has no significance to you when you're reading an explain plan-- it does have some significance when you are examining an event 10046 trace.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • About  EXPLAIN PLAN table

    Hi,
    This is just a sample query which I have executed on a recently installed Oracle ..
    SQL> explain plan for
    2 select * from emp
    3 where job = 'CLERK';
    select * from emp
    ERROR at line 2:
    ORA-02402: PLAN_TABLE not found
    When I have requested my DBA, he said, he couldnt find this (PLAN TABLE) utility in oracle .. Please advice me, from where can I get this utility ?? And how to proceed
    Regards

    SQL> explain plan for select sysdate from dual
      2  /
    Explained.
    SQL>  select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             |       |       |       |
    |   1 |  TABLE ACCESS FULL   | DUAL        |       |       |       |
    Note: rule based optimization
    9 rows selected.Cheers
    Sarma.

  • Questions about Integrated Planning and BPS

    Hi all,
    I'm testing the functions of BW7.0. And at the point of comparing the new BI Integrated Planning from the BPS, I'm stuck with 3 problems. Can anybody give me some solution?
    <b>i.</b> When using the input-ready layout of the BW-BPS 3.5, I was able to create a new record and load it up to the cube. Is it possible to make the same operation like this using the BI Integrated Planning of BW7.0?
    <b>ii.</b> When using the BW-BPS 3.5, showing the character hierarchy on the Manual planning layout can be chosen. And I'd like to show the BPS Characteristic Hierarchies in BI Integrated Planning of BW7.0 like it is in the BW-BPS 3.5. Is it possible to show the hierarchy in similar type somehow? If not,can't I show the sum of it anyhow? And if possible,can you also show the sum of the each hierarchy and change the data?
    <b>iii.</b> When showing the Characteristic combination data, can you choose how to show them from the transaction data or from all the combination like it was possible in the BW-BPS 3.5?
    Kind regards,
    Hiroshi Iwanaga

    Dear Beat,
    Thanks for your help.
    The information you gave me made a lot of help.
    Can I ask you more about the first question?
    About getting new lines in the table web item,as you have told me, I have set the parameter NEW_LINES_COUNT as 20 in the table web item. But when I execute it,no lines shows up. Is this a program error or am I setting the parameter in a wrong place?
    And this getting new lines feature, is it also possible when using a workbook?
    Thanks in advance,
    Hiroshi Iwanaga

  • Getting iphone, Questions about Family Plan. NEED HELP!

    So right  now I am on a family plan with my Dad and mother and we all have old phones that are basic basic. Our family plan has no Data plan at all, and in fact the plan is so old that it does not exist anymore. However I am moving away soon and I want to upgrade to an iphone. My question is this, If I upgrade, will I have to get my own plan? Or will I be able to just upgrade my phone and add the data charges just to my phone without making my parents upgrade their phones as well?
    Any help will be awesome. I don't want to go into the store and talk to a sales person because they are motivated by commission so it would be in their best interest to upgrade all or them. So if I can go in there educated about the specifics of upgrading it would help.
    Thanks!!

    Steveo15317 wrote:
    So right  now I am on a family plan with my Dad and mother and we all have old phones that are basic basic. Our family plan has no Data plan at all, and in fact the plan is so old that it does not exist anymore. However I am moving away soon and I want to upgrade to an iphone. My question is this, If I upgrade, will I have to get my own plan? Or will I be able to just upgrade my phone and add the data charges just to my phone without making my parents upgrade their phones as well?
    Any help will be awesome. I don't want to go into the store and talk to a sales person because they are motivated by commission so it would be in their best interest to upgrade all or them. So if I can go in there educated about the specifics of upgrading it would help.
    Thanks!!
    Thanks to our forum member for the great information!
    In addition, please note that you will most likely be able to keep your current calling plan when you upgrade your line to an iPhone 4; however, if the iPhone 4 is not compatible with your current calling plan you will be notified when you process your order online if you login to your My Verizon account and you will be presented with your new calling plan options.
    If your calling plan is compatible with the iPhone 4, you will be able to simple upgrade to the iPhone 4 device and add the data plan to your line. This does not affect your parents calling plan in any way. You can also separate your line from the family calling plan and have an individual calling plan for your line and have your parents lines stay with their family share plan.
    If you do not feel comfortable ordering your upgrade phone online or at a store, you can also order your upgrade from the comfort of your home if you dial 1-800-922-0204 to contact our customer service department.

  • Question about project plan value and  availability control

    dear expert:
    I had built a project, and with CJ30, Allocated budget is 10000, in one of  WBS element.
    I created  a network and internal activities,
    when I  assiged a material component (Res + PR) and system can be saved even if the total plan cost value is crossing the budget value.(There is no PR created, now. )
    But, Budget checking is showing error message that budget is exceeded when I created any external service activity and crossing the budget value.(There is also no PR created, now. )
    My question is: what is the difference of the two plan value? Why one is relevant to the budget,and the other is not?
    Note:1) the tolerance limit with ++ (all activity groups), usage say 100% & action 3 (error) to the budget profile. The budget prifile is considered with only overall budget.
    2)In tables COSP, "value types" are all 01 (plan), but VRGNG field values ​​are different, components plan is: KPPE
    Service activities are: KPPP
    3)in CJ30 u2013 Extras>> Availability Control>> Analysis. I could see the following in red colour, these values system not considering into account.
    Entries in this color make no contribution to the assigned value!
    V: Value type not relevant ( Act./Plan/Stat.Act./Stat.Plan/Commt)
    D: Delivery
    S: Settlement to object with no budget control
    R: Revenue cost element
    C: Cost element is exempt cost element
    M: Minimum from actual + commitment and plan per order value update
    P: Plan value is not on apportioned order / network
    B: Plan Costing Single Position
    S: Funds Commitment in Balance
    Following is for material
    COSP 2011 01 8001110100     0000000200 KPPE D RMB             200,000.00  RMB   B
    Following is for service
    COSP 2011 01 8001110400  KPPP D RMB                                10.00  RMB
    regard
    mao jian

    Hi,
    Its not per item category. If  N or L sytem will check the budget if in your system if proper GL's are maintained in OBYC settings BSX and GBB > VBR nad cost elelemtns are created for them. for this you have to cosult with your MM / CO consultant.
    PS is highly inteergratd with CO and all values are updated per cost elements. If values are not updated in cost elements then budget chek wil not happen.
    In you case for material values may be updated in cost elements due to improper OBYC setting so budget check was not done.
    Chekc your OBYC setting and try to create material PR system will check for the budget.
    Check and confirm.
    regards,

  • Switching from Env Touch to a Droid 2     Questions about data plan.

    I have an Env Touch with Unlimited Texting. My mother has a Droid 2 with Unlimited Texting and Data (the $30 plan).
    I want to switch phones with her, but will I get the Unlimited Data plan with it or will I have to get the new payment plans for data?

    Verizon has a data calculator on this site (just search for it) that can give you some idea of your usage.  You can also visit the services you plan to use and look for information about how much data they consume.  2GB would not be enough with hours of Pandora streaming each month, but if you regularly used WiFi for the more data intensive applications, you could probably stay under the cap easily.
    If you go over your cap, you are billed $10 and get another 1GB of data to use.  You CAN use unlimited data, at a rate of $10/GB over your cap.

  • Question about using plans for more than one device

    I have a Verizon wireless broad band modem I currently use in conjunction for my lap top. I am looking at getting a cell phone soon and I am curious if I can use that plan, that is currently attached to the modem, with this hypothetical cellphone as well, or if I would need get separate plans for both devices.

    If you want to keep your data from being merged, you will need to have separate iCloud accounts with separate IDs.  You can still track your devices using Find My iPhone, you will just need to be signed into the iCloud account for the device you are trying to track.  You can also continue to share the same ID for iTunes purchasing; it does not need to be the same as the ID used for iCloud.
    In order to migrate your daughter to her own account, on her phone go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from her phone, not from iCloud.  Your devices will not be effected by this.)  When prompted about what to do with the iCloud data, choose Keep On My iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload her data to the new account.
    You can then go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't want from each account (such as deleting your daughter's contacts from your account, and vice versa).

  • I have a question about my plan due to the iphone.

    I plan on ordering the iphone on Feb. 3 which I am eligible for and whatnot.
     Anyhow once you receive the iphone and activate it can they just switch over the plan I already have?  I have the 39.99 Voice Unlimited data 29.99 and 10 text. 
    I also have a discount through my work.  If they don't switch over the same plan that I already have how does that work? Do they just need to apply the discount to my new plan and verify that I still work there or something?

    It doesn't matter whether or not you have the cheapest or most expensive voice and text plants, smartphones require a data plan to be eligible for a discount. It should be the same for the iPhone 4.
    As for any work discount, I don't think you need to do anything to continue to receive it. I receive a discount for working with the government and I didn't need to do anything when I changed my plan a couple of times before.

  • Question about family plan charges.

    Hey, I was just looking at my first bill since starting a family plan with two iPhones and they are charging me $9.99 for the second phone. When you choose your family plan it clearly states that the monthly charge is for the first two lines, and that each additional line will be charged $9.99. Should I be disputing this charge or is this something that all iPhone users encounter when buying a family plan? Thanks for the help.

    http://www.wireless.att.com:80/cell-phone-service/cell-phone-plans/
    It could be by location also. I entered mine and it said first two lines and gave a price. Then additional (third phone) $9.99 per month. So you could be right stinknuggets. Only way to know for sure is to contact AT&T though.

  • Questions about CC plans

    I am a student in college that would love to have the convenience of PS and After Affects at my apartment so that I do not have to stay at school all day and night working on assignments. If I were to get the Complete Plan for Students and Teachers for $19.99 a month would I get After Affects with that package, I know it says I will get PS and Illustrator but I'm just wondering if the "and more" would include After Affects. If it does not come with that package is there a way I can get it for a monthly fee or at least include it in the package?

    Yes, After Effects is Part of Complete Plan for Students and Teacher
    You can access all the products mentioned on below link
    Explore Adobe desktop apps | Adobe Creative Cloud

  • Question about (PSP) Plan

    With the PSP Plan can you just take the original item in its original box back to the store and exchange it for the same item? if this is incorrect tell me what to do.
    Solved!
    Go to Solution.

    ok when it comes to headsets they are usually replaced in store or given store credit (not to exceed original purchase price) should they be unavailable. Also keep in mind the plan does not cover damage so if they are physically damaged it wont be covered. But if they failed due to normal use then you should get replacements in store.

  • Question about storages plans

    i have an 10 gb what will happen with all my data if i cancell the 10 gb storage ?

    Thanks for the heads up, much appreciated 

  • Explain Plan

    Just Question about Explain Plan.
    Q- 1. Is it Possible to trace a current session query from other session without altering that session. If How can i do it. I can not do it with v$session becuase it will be different sessionid. Also i ndon't want to alter session.
    Q-2 I have SQl statement gives different EXECUTION PLAN on 9R2 and 10g. Is it possible.
    Can any one explain this please

    thank you smoradi and william for your response.
    Sorry for Long Post
    I tried to post it before also. i did not get the conculsion. This are the final results i got. So can any one Help me.
    Following are the information
    I have TKPROF result. can any one expalin me this what it means. Where are wait time.
    I got the explain plan as unnder can any one explain me please i am still having problem solving this
    can any one explain me how to improve the perfomance.
    1.SS_SKU_STORE_WEEk is the biggest table around 12 million rows.
    2. SS_SKU_STORE 50 thosand rows
    3. ITEM 44 thousand
    4.Rest all tables are small.
    SQL>  SELECT   /*+ index( ss_sku_store SS_SKU_ST_PK ) */
      2              TO_NUMBER( ss_sku_store.sku || ss_sku_store.store_num) rowkey,
      3              ss_sku_store.sku psku,
      4              ' ' || INITCAP( item.descrip ) description,
      5              dept_id,
      6              TO_CHAR( dept_id ) || '.' || TO_CHAR( sub_dept_id ) subdepartment,
      7              TO_CHAR( dept_id ) || '.' || TO_CHAR( sub_dept_id ) ||'.'|| TO_CHAR( class_id ) class,
      8              NVL( vendor_id, -1 ),
      9              NVL( buyer_num, -1),
    10              NVL( TRIM(pattern_cd), -1),
    11              DECODE(Color_Cd, 0, -1, NVL( Color_Cd, -1)) Color_Cd,
    12              NVL( size_cd, -1),
    13              -1 list_id,
    14              ss_sku.sku skuattribute,
    15              ss_sku_store.store_num pstore,
    16              INITCAP( store.name ) location,
    17              store.state,
    18              NVL( INITCAP( regional_vp), :cUNASSIGNED) regional_vp,
    19              NVL( INITCAP( regional_merch_mgr), :cUNASSIGNED) regional_merch_mgr,
    20              NVL( INITCAP( district_mgr), :cUNASSIGNED) district_mgr,
    21              NVL( INITCAP( area_mgr), :cUNASSIGNED) area_mgr,
    22              NVL( sq_footage, -1),
    23              SUBSTR( '000' || fashion_attribute.seq, -3, 3 ) || NVL( store.fashion_att_cd, '' ) fashion_att_cd,
    24              SUBSTR( '000' || cust_profile.seq, -3, 3 ) || NVL( store.cust_type_cd, '' ) cust_type_cd,
    25              NVL( section_count, -1) section_count,
    26              '000' corp_vol_grp_cd,
    27              0 storegroup,
    28              store.store_num storeattribute,
    29              0 storesort,
    30              submit_status,
    31              DECODE( current_user, :pUserID, shipment_schedules.check_staged_sku(ss_sku_store.sku,-1), 1) lockedflag,
    32              '' aggregatedrowkey,
    33              '' AttributeDescription,
    34              starting_on_hand     onhand
    35     FROM     cust_profile,
    36              fashion_attribute,
    37              ( SELECT   vendor_id,
    38                         sku
    39                FROM     item_vendor
    40                WHERE    sku IN ( SELECT  sku
    41                                  FROM    ss_session_sku
    42                                  WHERE   user_key = :pUserKey)
    43                AND      primary_flag = :cTRUE ) primaryvendor,
    44              ( SELECT   SKU,
    45                         DECODE( status, 0, 0, DECODE( status, 1 ,0 ,1) ) AS submit_status
    46                FROM     ( SELECT   /*+ full(ss_session_sku) use_nl(ss_session_sku,ss_sku_store_week) index(ss_sku_store_week SS_SKU_STR_WK_SKU )*/
    47                                    SS_SKU_Store_Week.SKU,
    48                                    MAX( NVL( ssk_week_status, 0 ) ) AS status
    49                           FROM     ss_session_sku,
    50                                    ss_sku_store_week
    51                           WHERE    user_key              = :pUserKey
    52                           AND      ss_sku_store_week.sku = ss_session_sku.sku
    53                           GROUP BY ss_sku_store_week.sku )
    54               ) sku_status,
    55              ss_sku,
    56              store,
    57              ss_sku_store,
    58              item
    59     WHERE    sku_status.sku           =  item.sku
    60     AND      sku_status.sku           =  ss_sku.sku
    61     AND      sku_status.sku           =  ss_sku_store.sku
    62     AND      sku_status.sku           =  primaryvendor.sku
    63     AND      sku_status.sku           =  sku_status.sku
    64     AND      ss_sku_store.store_num   =  store.store_num
    65     AND      store.cust_type_cd       =  cust_profile.cust_type_cd(+)
    66     AND      store.fashion_att_cd     =  fashion_attribute.fashion_att_cd(+)
    67     ORDER BY ss_sku_store.sku,
    68              ss_sku_store.store_num;
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=531 Card=3203 Bytes=948088)                                                            
       1    0  SORT (GROUP BY) (Cost=531 Card=3203 Bytes=948088)                  
       2    1    HASH JOIN (RIGHT OUTER) (Cost=323 Card=3203 Bytes=948088)                                                                    
       3    2      TABLE ACCESS (FULL) OF 'CUST_PROFILE' (TABLE) (Cost=2 Card=16 Bytes=304)                                                   
       4    2      HASH JOIN (RIGHT OUTER) (Cost=321 Card=3203 Bytes=887231)                                                                  
       5    4        TABLE ACCESS (FULL) OF 'FASHION_ATTRIBUTE' (TABLE) (Cost=2 Card=9 Bytes=162)                                             
       6    4        HASH JOIN (Cost=318 Card=3203 Bytes=829577)                  
       7    6          TABLE ACCESS (FULL) OF 'STORE' (TABLE) (Cost=15 Card=1289 Bytes=105698)                                                
       8    6          TABLE ACCESS (BY LOCAL INDEX ROWID) OF 'SS_SKU_STORE' (TABLE) (Cost=3 Card=707 Bytes=17675)                            
       9    8           NESTED LOOPS (Cost=302 Card=3203 Bytes=566931)           
      10    9             HASH JOIN (Cost=287 Card=5 Bytes=760)                  
      11   10               NESTED LOOPS (Cost=284 Card=5 Bytes=655)             
      12   11                 NESTED LOOPS (Cost=273 Card=5 Bytes=270)           
      13   12                   NESTED LOOPS (Cost=252 Card=86 Bytes=3784)                                                                   
      14   13                     NESTED LOOPS (Cost=17 Card=13 Bytes=468)                                                                   
      15   14                       SORT (UNIQUE) (Cost=1 Card=13 Bytes=130)                                                                 
      16   15                         INDEX (RANGE SCAN) OF 'SS_SESS_SKU_PK' (INDEX (UNIQUE)) (Cost=1 Card=13 Bytes=130)                     
      17   14                       TABLE ACCESS (BY INDEX ROWID) OF 'ITEM_VENDOR' (TABLE) (Cost=3 Card=1 Bytes=26)                          
      18   17                         INDEX (RANGE SCAN) OF 'ITEM_VENDOR_ITEM_FK_IDX' (INDEX) (Cost=2 Card=1)                                
      19   13                     PARTITION HASH (ITERATOR) (Cost=65 Card=7 Bytes=56)                                                        
      20   19                       TABLE ACCESS (BY LOCAL INDEX ROWID)OF 'SS_SKU_STORE_WEEK' (TABLE) (Cost=65 Card=7 Bytes=56)             
      21   20                         INDEX (RANGE SCAN) OF 'SS_SKU_STR_WK_SKU' (INDEX) (Cost=14 Card=6427)                                  
      22   12                   TABLE ACCESS (FULL) OF 'SS_SESSION_SKU'(TABLE) (Cost=0 Card=1 Bytes=10)                                     
      23   11                 TABLE ACCESS (BY INDEX ROWID) OF 'ITEM' (TABLE) (Cost=2 Card=1 Bytes=77)                                       
      24   23                   INDEX (UNIQUE SCAN) OF 'ITEM_PK' (INDEX (UNIQUE)) (Cost=1 Card=1)                                            
      25   10               TABLE ACCESS (FULL) OF 'SS_SKU' (TABLE) (Cost=3 Card=343 Bytes=7203)                                             
      26    9             PARTITION HASH (ITERATOR) (Cost=1 Card=211)
      27   26               INDEX (RANGE SCAN) OF 'SS_SKU_ST_PK' (INDEX(UNIQUE)) (Cost=1 Card=211)                                          
    EXPLIAN PLAN AND DATA FROM TKPROF
    all     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.01          0          0          0           0
    Execute      2      1.35       1.30          0          0          0           0
    Fetch        5      0.14       0.16          5       2497          0         111
    total        9      1.49       1.49          5       2497          0         111
    Misses in library cache during parse: 2
    Misses in library cache during execute: 2
    Optimizer mode: ALL_ROWS
    Parsing user id: 30  (MDSEADMIN)
    Rows     Row Source Operation
          0  PX COORDINATOR FORCED SERIAL (cr=797 pr=2 pw=0 time=42745 us)
          0   PX SEND QC (ORDER) :TQ10005 (cr=797 pr=2 pw=0 time=42711 us)
          0    SORT ORDER BY (cr=797 pr=2 pw=0 time=42701 us)
          0     PX RECEIVE  (cr=797 pr=2 pw=0 time=42627 us)
          0      PX SEND RANGE :TQ10004 (cr=797 pr=2 pw=0 time=42617 us)
          0       BUFFER SORT (cr=797 pr=2 pw=0 time=42609 us)
          0        NESTED LOOPS OUTER (cr=797 pr=2 pw=0 time=42532 us)
          0         NESTED LOOPS OUTER (cr=797 pr=2 pw=0 time=42520 us)
          0          NESTED LOOPS  (cr=797 pr=2 pw=0 time=42510 us)
          0           NESTED LOOPS  (cr=797 pr=2 pw=0 time=42502 us)
          0            NESTED LOOPS  (cr=797 pr=2 pw=0 time=42495 us)
          0             NESTED LOOPS  (cr=797 pr=2 pw=0 time=42488 us)
          0              HASH JOIN  (cr=797 pr=2 pw=0 time=42480 us)
          1               BUFFER SORT (cr=5 pr=1 pw=0 time=13357 us)
          1                PX RECEIVE  (cr=5 pr=1 pw=0 time=13300 us)
          1                 PX SEND HASH :TQ10001 (cr=5 pr=1 pw=0 time=13291 us)
          1                  TABLE ACCESS BY INDEX ROWID ITEM_VENDOR (cr=5 pr=1 pw=0 time=13280 us)
          3                   NESTED LOOPS  (cr=4 pr=0 pw=0 time=423 us)
          1                    SORT UNIQUE (cr=1 pr=0 pw=0 time=189 us)
          1                     INDEX RANGE SCAN SS_SESS_SKU_PK (cr=1 pr=0 pw=0 time=86 us)(object id 25279)
          1                    INDEX RANGE SCAN ITEM_VENDOR_ITEM_FK_IDX (cr=3 pr=0 pw=0 time=53 us)(object id 24079)
          0               PX RECEIVE  (cr=792 pr=1 pw=0 time=28530 us)
          0                PX SEND HASH :TQ10003 (cr=792 pr=1 pw=0 time=28524 us)
          0                 VIEW  (cr=792 pr=1 pw=0 time=28517 us)
          0                  HASH GROUP BY (cr=792 pr=1 pw=0 time=28509 us)
          0                   PX RECEIVE  (cr=792 pr=1 pw=0 time=28295 us)
          0                    PX SEND HASH :TQ10002 (cr=792 pr=1 pw=0 time=28290 us)
          0                     NESTED LOOPS  (cr=792 pr=1 pw=0 time=28284 us)
          1                      BUFFER SORT (cr=1 pr=0 pw=0 time=139 us)
          1                       PX RECEIVE  (cr=1 pr=0 pw=0 time=45 us)
          1                        PX SEND BROADCAST :TQ10000 (cr=1 pr=0 pw=0 time=40 us)
          1                         INDEX RANGE SCAN SS_SESS_SKU_PK (cr=1 pr=0 pw=0 time=34 us)(object id 25279)
          0                      PX BLOCK ITERATOR PARTITION: KEY KEY (cr=791 pr=1 pw=0 time=28136 us)
          0                       TABLE ACCESS FULL SS_SKU_STORE_WEEK PARTITION: KEY KEY (cr=791 pr=1 pw=0 time=28084 us)
          0              TABLE ACCESS BY INDEX ROWID ITEM (cr=0 pr=0 pw=0 time=0 us)
          0               INDEX UNIQUE SCAN ITEM_PK (cr=0 pr=0 pw=0 time=0 us)(object id 24055)
          0             TABLE ACCESS BY INDEX ROWID SS_SKU (cr=0 pr=0 pw=0 time=0 us)
          0              INDEX UNIQUE SCAN SS_SKU_PK (cr=0 pr=0 pw=0 time=0 us)(object id 25300)
          0            PARTITION HASH ITERATOR PARTITION: KEY KEY (cr=0 pr=0 pw=0 time=0 us)
          0             TABLE ACCESS BY LOCAL INDEX ROWID SS_SKU_STORE PARTITION: KEY KEY (cr=0 pr=0 pw=0 time=0 us)
          0              INDEX RANGE SCAN SS_SKU_ST_PK PARTITION: KEY KEY (cr=0 pr=0 pw=0 time=0 us)(object id 25547)
          0           TABLE ACCESS BY INDEX ROWID STORE (cr=0 pr=0 pw=0 time=0 us)
          0            INDEX UNIQUE SCAN STORE_PK (cr=0 pr=0 pw=0 time=0 us)(object id 25586)
          0          TABLE ACCESS BY INDEX ROWID FASHION_ATTRIBUTE (cr=0 pr=0 pw=0 time=0 us)
          0           INDEX UNIQUE SCAN FASHION_ATTRIBUTE_PK (cr=0 pr=0 pw=0 time=0 us)(object id 24035)
          0         TABLE ACCESS BY INDEX ROWID CUST_PROFILE (cr=0 pr=0 pw=0 time=0 us)
          0          INDEX UNIQUE SCAN CUST_PROFILE_PK (cr=0 pr=0 pw=0 time=0 us)(object id 24036)
    ALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       43      0.10       0.11          0          1          0           0
    Execute    861      0.38       0.45        357        622         46         621
    Fetch      845      0.21       0.21        128       2626          2         892
    total     1749      0.69       0.78        485       3249         48        1513
    Misses in library cache during parse: 21
    Misses in library cache during execute: 16
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                      60        0.00          0.00
      SQL*Net message from client                    39        0.00          0.16
      db file scattered read                         82        0.01          0.05
      db file sequential read                       185        0.01          0.05
      log file sync                                   1        0.00          0.00
      191  user  SQL statements in session.
       23  internal SQL statements in session.
      214  SQL statements in session.
       37  statements EXPLAINed in this session.Thank you for your help in advance
    Message was edited by:
    devmiral

Maybe you are looking for