How to Reduce cost of full table scan or remove full table scan while execu

Dear Experts
need your help.
I execute a query and create a explain plan in that plan i found cost of a table is very high (2777) and it was full table scan.
Please guide me How to Reduce cost of full table scan or remove full table scan while execute the query.
Thanks

Need your help to tune this query..
SELECT DISTINCT ool.org_id, ool.header_id, ooh.order_number, ool.line_id,
ool.line_number, ool.shipment_number,
NVL (ool.option_number, -99) option_number, xcl.GROUP_ID,
xcl.attribute3, xcl.attribute4
FROM oe_order_headers ooh,
xxcn_comp_header xch,
xxcn_comp_lines xcl,
fnd_lookup_values_vl fvl,
oe_order_lines ool
WHERE 1 = 1
AND ooh.org_id = 1524
AND xch.src_ref_no = TO_CHAR (ooh.order_number)
AND xch.src_ref_id = ooh.header_id
AND xch.org_id = 1524
AND xcl.header_id = xch.header_id
AND ool.line_id = xcl.oe_line_id
AND ool.flow_status_code IN
('WWD_SHIPPED',
'FULFILLED',
'SHIPPED',
'CLOSED',
'RETURNED'
AND ool.org_id = 1524
AND ool.header_id = ooh.header_id
AND xch.org_id = 1524
AND fvl.lookup_type = 'EMR OIC SOURCE FOR OU'
AND fvl.tag = '1524'
AND fvl.description = xch.SOURCE
AND EXISTS (
SELECT 1
FROM oe_order_lines oe
WHERE oe.header_id = ool.header_id
AND oe.org_id = 1524
AND oe.line_number = ool.line_number
AND oe.ordered_item = ool.ordered_item
AND oe.shipment_number > ool.shipment_number
AND NVL (oe.option_number, -99) =
NVL (ool.option_number,
-99)
AND NOT EXISTS (
SELECT 1
FROM xxcn_comp_lines xcl2
WHERE xcl.GROUP_ID = xcl2.GROUP_ID
AND oe.line_id = oe_line_id))
call count cpu elapsed disk query current rows
Parse 1 0.07 0.12 12 25 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 103.03 852.42 176206 4997766 0 12
total 4 103.10 852.55 176218 4997791 0 12
In this LIO is very high...can u please help in resolving this performance issue

Similar Messages

  • How to reduce costs and increase efficiency of pho...

    Dear Skype community! 
    I need to find some information about how to reduce costs and increase efficiency of phone calls in sales organisation? 
    What are advantages of Skype contarry to the concurrence ? I'm Inside Sales manager SEMEA
    Is there anyone who can explaine ? 
    thanks a lot !
    Solved!
    Go to Solution.

    Tilly_in_action,
    Review the following link:
    http://blogs.skype.com/2012/05/24/5-real-benefits-of-using-skype/
    Thanks,
    Kent C.

  • How to reduce cost for SAP Fiori Trial on CAL?

    Hi,
    I have created an account in Cloud Appliance Library with AWS as per OpenSAP  Course.
    It's showing the cost per hour as 3.30 USD  and per month 2379.20 USD.
    Can anyone suggest me how to reduce this cost per month to the minimum.
    I can't pay this much amount.
    Please guide how to utilize this at the optimum w.r.t to the cost.
    Regards,
    Ramana.

    Hi Ramana,
    The easiest way to optimize the costs is to suspend the instance when not used. The scheduling options in SAP CAL could help here.
    Best regards,
    Stanimir

  • How to reduce Costing

    I have following query but the query takes too high costing, how should i reduce the cost.
    TRANCHE_BALANCE table having partition.
    query is
    SELECT /* + NO_USE_HASH(tbb) index(tbb XIE3TRANCHE_BALANCE) index (tbb XIE4TRANCHE_BALANCE) */
    tbb.project_id, tbb.tranche_nbr,
    tbb.summary_date,
    tbb.product_sub_type_code,
    tbb.product_type_code,
    CAST (tbb.crmcmt_usd_amt AS NUMBER) crmcmt_usd_amt,
    CAST (tbb.crmdout_usd_amt AS NUMBER) crmdout_usd_amt,
    CAST (tbb.crmmtm_usd_amt AS NUMBER) crmmtm_usd_amt,
    CAST (tbb.crmoleq_usd_amt AS NUMBER) crmoleq_usd_amt,
    CAST (tbb.crmunds_usd_amt AS NUMBER) crmunds_usd_amt,
    CAST (tbb.crmamtm_usd_amt AS NUMBER) crmamtm_usd_amt
    FROM mis.tranche_balance tbb,
    mis.product_categorization pc
    Where tbb.product_type_code = pc.product_type_code
    AND tbb.product_sub_type_code = pc.product_sub_type_code;
    PLAN SHOWS
    SELECT STATEMENT CHOOSE
    Cost :18,846 Bytes 97,768,6-368 Cardinality: 2,036,841
    # HASH JOIN
    Cost:18,846 Bytes :252 Cardinality : 2,036,841
    INDEX FULL SCAN UNIQUE MIS.XPKPRODUCT_CATGORIZATION
    Cost : 2 Bytes:252 Cardinality :36
    PARTITION RANGE ALL
    Partition #:3 Partition acessed #1 - #122
    TABLE ACCESS FULL MIS.TRANCHE_BALANCE
    Cost :18,789 Bytes : 83,510,481 Cardinality:2,036,841
    Partition #:3 Partition acessed #1 - #122
    Thanks for advance

    debasishghosh wrote:
    I have following query but the query takes too high costing, how should i reduce the cost.
    TRANCHE_BALANCE table having partition.Firstly, regardless of the "cost", is the query performant? If not, take a read of the following thread...
    When your query takes too long ...
    Secondly, it would be helpful, when you post code or data, if you put {noformat}{noformat} tags before and after it so that the formatting is retained on the forum.  I'll do that here for you for now...SELECT /* + NO_USE_HASH(tbb) index(tbb XIE3TRANCHE_BALANCE) index (tbb XIE4TRANCHE_BALANCE) */
    tbb.project_id, tbb.tranche_nbr,
    tbb.summary_date,
    tbb.product_sub_type_code,
    tbb.product_type_code,
    CAST (tbb.crmcmt_usd_amt AS NUMBER) crmcmt_usd_amt,
    CAST (tbb.crmdout_usd_amt AS NUMBER) crmdout_usd_amt,
    CAST (tbb.crmmtm_usd_amt AS NUMBER) crmmtm_usd_amt,
    CAST (tbb.crmoleq_usd_amt AS NUMBER) crmoleq_usd_amt,
    CAST (tbb.crmunds_usd_amt AS NUMBER) crmunds_usd_amt,
    CAST (tbb.crmamtm_usd_amt AS NUMBER) crmamtm_usd_amt
    FROM mis.tranche_balance tbb,
    mis.product_categorization pc
    Where tbb.product_type_code = pc.product_type_code
    AND tbb.product_sub_type_code = pc.product_sub_type_code;
    SELECT STATEMENT CHOOSE
    Cost :18,846 Bytes 97,768,6-368 Cardinality: 2,036,841
    # HASH JOIN
    Cost:18,846 Bytes :252 Cardinality : 2,036,841
    INDEX FULL SCAN UNIQUE MIS.XPKPRODUCT_CATGORIZATION
    Cost : 2 Bytes:252 Cardinality :36
    PARTITION RANGE ALL
    Partition #:3 Partition acessed #1 - #122
    TABLE ACCESS FULL MIS.TRANCHE_BALANCE
    Cost :18,789 Bytes : 83,510,481 Cardinality:2,036,841
    Partition #:3 Partition acessed #1 - #122
    Without knowing your tables and what indexes you have defined on them and without knowing the number of rows of data as well as the cardinality and selectivity of the data, we're not going to be able to give any real advice.
    What happens if you leave out the Hints?  (Index and Optimiser Hints shouldn't be used in production code, they should only be used for debugging - with the exception of the APPEND hints for inserts)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to reduce costs of ISP

    i have Qwest into my house...$50/month, then ISP, an additional $55/month...which is for VOIP and email...i am fixing to retire and need to seriously reduce my expenses...ideas?  most appreciated!!!

    Qwest ....can also be ISP for more$$$...
    So it's telephone plus cable plus internet, at $105 a month, or nothing? That is totally unreasonable. I would tell them either unbundle their Internet from cable TV, or take a hike. You should be paying half that.
    I'm with steve - no cable in Galt's Gulch. No TV at all. Never been happier. Netflix is all I need.

  • How to Enable Cost Center Field in Infotype 0001

    Dear all my Friends,
    Can anybody please tell me that how to Enable Cost Center Field in Infotype 0001, actually the problem is while hiring the employee the field itself disable and not allowing me to put any CC on that field but which should be enable while hiring or if we intend to change in future through PA30 and after that i thought i can do in Infotype 0027 also but in infotype 27 the field called Master Cost Center field is still disabled which will reflect in 0001 or Vice Versa.
    So friends pls tell me where my configuration is wrong or how will i get enable that field in 0001 infotype so that i calculated the cost of that employee.
    Waiting for ur Reply friends,
    Thanks,
    Prashant.

    Dear Rajesh,
    Thanx for ur Solution and i got the answer, actually i m maintaining through OM and u gave me the exact solution .
    Gr8 job dear. Thanx allot once again
    Thanks,
    Prashant.

  • How to find the count of tables going for fts(full table scan in oracle 10g

    HI
    how to find the count of tables going for fts(full table scan) in oracle 10g
    regards

    Hi,
    Why do you want to 'find' those tables?
    Do you want to 'avoid FTS' on those tables?
    You provide little information here. (Perhaps you just migrated from 9i and having problems with certain queries now?)
    FTS is sometimes the fastest way to retrieve data, and sometimes an index scan is.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    There's no 'FTS view' available, if you want to know what happens on your DB you need, like Anand already said, to trace sessions that 'worry you'.

  • In  a SQL query whihc has join, How to reduce Multiple instance of a table

    in a SQL query which has join, How to reduce Multiple instance of a table
    Here is an example: I am using Oracle 9i
    is there a way to reduce no.of Person instances from the following query? or can I optimize this query further?
    TABLES:
    mail_table
    mail_id, from_person_id, to_person_id, cc_person_id, subject, body
    person_table
    person_id, name, email
    QUERY:
    SELECT p_from.name from, p_to.name to, p_cc.name cc, subject
    FROM mail, person p_from, person p_to, person p_cc
    WHERE from_person_id = p_from.person_id
    AND to_person_id = p_to.person_id
    AND cc_person_id = p_cc.person_id
    Thnanks in advance,
    Babu.

    SQL> select * from mail;
            ID          F          T         CC
             1          1          2          3
    SQL> select * from person;
           PID NAME
             1 a
             2 b
             3 c
    --Query with only ne Instance of PERSON Table
    SQL> select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
      2         max(decode(m.t,p.pid,p.name)) to_name,
      3         max(decode(m.cc,p.pid,p.name)) cc_name
      4  from mail m,person p
      5  where m.f = p.pid
      6  or m.t = p.pid
      7  or m.cc = p.pid
      8  group by m.id;
            ID FRM_NAME   TO_NAME    CC_NAME
             1 a          b          c
    --Expalin plan for "One instance" Query
    SQL> explain plan for
      2  select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
      3         max(decode(m.t,p.pid,p.name)) to_name,
      4         max(decode(m.cc,p.pid,p.name)) cc_name
      5  from mail m,person p
      6  where m.f = p.pid
      7  or m.t = p.pid
      8  or m.cc = p.pid
      9  group by m.id;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 902563036
    | Id  | Operation           | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |        |     3 |   216 |     7  (15)| 00:00:01 |
    |   1 |  HASH GROUP BY      |        |     3 |   216 |     7  (15)| 00:00:01 |
    |   2 |   NESTED LOOPS      |        |     3 |   216 |     6   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| MAIL   |     1 |    52 |     3   (0)| 00:00:01 |
    |*  4 |    TABLE ACCESS FULL| PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       4 - filter("M"."F"="P"."PID" OR "M"."T"="P"."PID" OR
                  "M"."CC"="P"."PID")
    Note
       - dynamic sampling used for this statement
    --Explain plan for "Normal" query
    SQL> explain plan for
      2  select m.id,pf.name fname,pt.name tname,pcc.name ccname
      3  from mail m,person pf,person pt,person pcc
      4  where m.f = pf.pid
      5  and m.t = pt.pid
      6  and m.cc = pcc.pid;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4145845855
    | Id  | Operation            | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |        |     1 |   112 |    14  (15)| 00:00:01 |
    |*  1 |  HASH JOIN           |        |     1 |   112 |    14  (15)| 00:00:01 |
    |*  2 |   HASH JOIN          |        |     1 |    92 |    10  (10)| 00:00:01 |
    |*  3 |    HASH JOIN         |        |     1 |    72 |     7  (15)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL| MAIL   |     1 |    52 |     3   (0)| 00:00:01 |
    |   5 |     TABLE ACCESS FULL| PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |   6 |    TABLE ACCESS FULL | PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    |   7 |   TABLE ACCESS FULL  | PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("M"."CC"="PCC"."PID")
       2 - access("M"."T"="PT"."PID")
       3 - access("M"."F"="PF"."PID")
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement
    25 rows selected.
    Message was edited by:
            jeneesh
    No indexes created...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem of full table scan on a partitioned table

    hi all
    There is a table called "si_sync_operation" that have 171040 number of rows.
    I partitioned that table into a new table called "si_sync_operation_par" with 7 partitoins.
    I issued the following statements
    SELECT * FROM si_sync_operation_par.
    SELECT * FROM si_sync_operation.
    The explain plan show that the cost of the first statement is 1626 and that of the second statments is 1810.
    The "cost" of full table scan on partitioned table is lower than the that of non-partitioned table.That's fine.
    But the "Bytes" of full table scan on partitioned table is 5761288680 and that of the non-partitioned table is 263743680.
    Why full table scan on partitioned table access more bytes than non-partitioned table?
    And how could a statment that access more bytes results a lower cost?
    Thank u very much

    As Hemant metioned bytes reported are approximate number of bytes. As far as Cost is concerned, according to Tom its just a number and we should not compare queries by their cost. (search asktom.oracle.com for more information)
    SQL> drop table non_part purge;
    Table dropped.
    SQL> drop table part purge;
    Table dropped.
    SQL>
    SQL> CREATE TABLE non_part
      2        (id  NUMBER(5),
      3         dt    DATE);
    Table created.
    SQL>
    SQL> CREATE TABLE part
      2        (id  NUMBER(5),
      3         dt    DATE)
      4         PARTITION BY RANGE(dt)
      5         (
      6         PARTITION part1_jan2008 VALUES LESS THAN(TO_DATE('01/02/2008','DD/MM/YYYY')),
      7         PARTITION part2_feb2008 VALUES LESS THAN(TO_DATE('01/03/2008','DD/MM/YYYY')),
      8         PARTITION part3_mar2008 VALUES LESS THAN(TO_DATE('01/04/2008','DD/MM/YYYY')),
      9         PARTITION part4_apr2008 VALUES LESS THAN(TO_DATE('01/05/2008','DD/MM/YYYY')),
    10         PARTITION part5_may2008 VALUES LESS THAN(TO_DATE('01/06/2008','DD/MM/YYYY'))
    11       );
    Table created.
    SQL>
    SQL>
    SQL> insert into non_part select rownum, trunc(sysdate) - rownum from dual connect by level <= 140;
    140 rows created.
    Execution Plan
    Plan hash value: 1731520519
    | Id  | Operation                     | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | INSERT STATEMENT              |      |     1 |     2   (0)| 00:00:01 |
    |   1 |  COUNT                        |      |       |            |          |
    |*  2 |   CONNECT BY WITHOUT FILTERING|      |       |            |          |
    |   3 |    FAST DUAL                  |      |     1 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(LEVEL<=140)
    SQL>
    SQL> insert into part select * from non_part;
    140 rows created.
    Execution Plan
    Plan hash value: 1654070669
    | Id  | Operation         | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | INSERT STATEMENT  |          |   140 |  3080 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| NON_PART |   140 |  3080 |     3   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> set line 10000
    SQL> set autotrace traceonly exp
    SQL> select * from non_part;
    Execution Plan
    Plan hash value: 1654070669
    | Id  | Operation         | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |          |   140 |  3080 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| NON_PART |   140 |  3080 |     3   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement
    SQL> select * from part;
    Execution Plan
    Plan hash value: 3392317243
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT    |      |   140 |  3080 |     9   (0)| 00:00:01 |       |       |
    |   1 |  PARTITION RANGE ALL|      |   140 |  3080 |     9   (0)| 00:00:01 |     1 |     5 |
    |   2 |   TABLE ACCESS FULL | PART |   140 |  3080 |     9   (0)| 00:00:01 |     1 |     5 |
    Note
       - dynamic sampling used for this statement
    SQL>
    SQL> exec dbms_stats.gather_table_stats(user, 'non_part');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user, 'part');
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL> select * from non_part;
    Execution Plan
    Plan hash value: 1654070669
    | Id  | Operation         | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |          |   140 |  1540 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| NON_PART |   140 |  1540 |     3   (0)| 00:00:01 |
    SQL> select * from part;
    Execution Plan
    Plan hash value: 3392317243
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT    |      |   140 |  1540 |     9   (0)| 00:00:01 |       |       |
    |   1 |  PARTITION RANGE ALL|      |   140 |  1540 |     9   (0)| 00:00:01 |     1 |     5 |
    |   2 |   TABLE ACCESS FULL | PART |   140 |  1540 |     9   (0)| 00:00:01 |     1 |     5 |
    SQL>After analyzing the tables, notice that the Bytes column has changed value

  • How to reduce downtime for setup table

    Scenario u2013According to system data, Setup table will normally take 5 days to fill but client agreed only for max 2 days downtime. User can do change only last 3 month documents not before that. For filling 3 month data in set up table 1 day required so I have to mange options accordingly.
    Datasource u2013 2LIS_13_VDITM -> DSO u2013 ZBIllIG ->Info cube
    I have to Reduce Downtime for Setup table so planning following optionsu2013
    1.     First run the info package for Initialization without data transfer. Then start filling setup table without blocking the User. In case Users changes any document at the time of filling setup table then these changes will move to delta queue. Once setup table filled then execute full repair request and then Delta info package.
    2.     Early delta initialization u2013 no idea how to perform steps.
    Please share your views with detail steps.
    OLI*BW doesnu2019t have any date range in selection criteria so manually I will find out document for particular dates and use these document range.
    Checked lot of post in SDN but still expecting final answer to go ahead in Production.

    Hi ,
    Your requirement is Billing ODS and Cube - Reset up in R/3 SYSTEM & Initialization in BW SYSTEM .
    Before starting find the previous data load volume and size.
    1.Go to LBWG application value=13 (Always Schedule the job in the back-ground mode)
    2.Verify using tcode u2018SE16u2019 that there are NO records in u2018MC13VD0ITMSETUPu2019 table after above delete job is complete.
    3.Suspend the process chain job in BW.This is to avoid it getting kicked off while the reload process is still in progress.
    4.Need to check LBWQ in R/3 system for MCEX13, unprocessed Outbound queue (records). This should be empty as the last delta would have processed all.
    5.Delete the initflag in BW.
    6.Need to check RSA7 in R/3 SYSTEM to verify that there is NO record for 2LIS_13_VDITM    (to be done right before the Setup job).
    7.Create New Info Package for Info Source '2LIS_13_VDITM' for u2018Initialize without Data Transfer Optionu2019 .Execute the package.Re-establish the Delta processing flags in R/3 and BW for the Billing TD load .
    8.Save the record count for table u2018VBRPu2019 using SE16 right before the setup job.
    9.Schedule Billing Data Setup Job 'OLI9BW'  in R/3 SYSTEM .
    10.After the Billing Setup job is complete in R/3 system, get the record count of table u2018VBRPu2019 again using u2018SE16u2019
    Expeted time in R/3:5 to 7 hrs(setupjobs)
    Expeted time for init and fullload : 6 hrs
    ODS activation : 3hrs
    Cube and with agrregates fill all : 8hrs.
    Thanks,
    naidu.

  • Do partition scans take longer than a full table scan on an unpartitioned table?

    Hello there,
    I have a range-partitioned table PART_TABLE which has 10 Million records and 10 partitions having 1 million records each. Partition is done based on a Column named ID which is a sequence from 1 to 10 million.
    I created another table P2_BKP (doing a select * from part_table) which has the same dataset as that of PART_TABLE except that this table is not partitioned.
    Now, I run a same query on both the tables to retrieve a range of data. Precisely I am trying to read only the data present in 5 partitions of the partitioned tables which theoretically requires less reads than when done on unpartitioned tables.
    Yet, the query seems to take extra time on partitioned table than when run on unpartitioned table.Any specific reason why is this the case?
    Below is the query I am trying to run on both the tables and their corresponding Explain Plans.
    QUERY A
    =========
    select * from P2_BKP where id<5000000;
    | Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |                                                                                                                                                                                                                                
    |   0 | SELECT STATEMENT  |        |  6573K|   720M| 12152   (2)| 00:02:26 |                                                                                                                                                                                                                                
    |*  1 |  TABLE ACCESS FULL| P2_BKP |  6573K|   720M| 12152   (2)| 00:02:26 |                                                                                                                                                                                                                                
    QUERY B
    ========
    select * from part_table where id<5000000;
    | Id  | Operation                | Name       | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |                                                                                                                                                                                                     
    |   0 | SELECT STATEMENT         |            |  3983K|   436M| 22181  (73)| 00:04:27 |       |       |                                                                                                                                                                                                     
    |   1 |  PARTITION RANGE ITERATOR|            |  3983K|   436M| 22181  (73)| 00:04:27 |     1 |     5 |                                                                                                                                                                                                     
    |*  2 |   TABLE ACCESS FULL      | PART_TABLE |  3983K|   436M| 22181  (73)| 00:04:27 |     1 |     5 |                                                                                                                                                                                                     

    at the risk of bringing unnecessary confusion into the discussion: I think there is a situation in 11g in which a Full Table Scan on a non partitioned table can be faster than the FTS on a corresponding partitioned table: if the size of the non partitioned table reaches a certain threshold (I think it's: blocks > _small_table_threshold * 5) the runtime engine may decide to use a serial direct path read to access the data. If the single partitions don't pass the threshold the engine will use the conventional path.
    Here is a small example for my assertion:
    -- I create a simple partitioned table
    -- and a corresponding non-partitioned table
    -- with 1M rows
    drop table tab_part;
    create table tab_part (
        col_part number
      , padding varchar2(100)
    partition by list (col_part)
        partition P00 values (0)
      , partition P01 values (1)
      , partition P02 values (2)
      , partition P03 values (3)
      , partition P04 values (4)
      , partition P05 values (5)
      , partition P06 values (6)
      , partition P07 values (7)
      , partition P08 values (8)
      , partition P09 values (9)
    insert into tab_part
    select mod(rownum, 10)
         , lpad('*', 100, '*')
      from dual
    connect by level <= 1000000;
    exec dbms_stats.gather_table_stats(user, 'tab_part')
    drop table tab_nopart;
    create table tab_nopart
    as
    select *
      from tab_part;
    exec dbms_stats.gather_table_stats(user, 'tab_nopart')
    -- my _small_table_threshold is 1777 and the partitions
    -- have a size of ca. 1600 blocks while the non-partitioned table
    -- contains 15360 blocks
    -- I have to flush the buffer cache since
    -- the direct path access is only used
    -- if there are few blocks already in the cache
    alter system flush buffer_cache;
    -- the execution plans are not really exciting
    | Id  | Operation           | Name     | Rows  | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT    |          |     1 |  8089   (0)| 00:00:41 |       |       |
    |   1 |  SORT AGGREGATE     |          |     1 |            |          |       |       |
    |   2 |   PARTITION LIST ALL|          |  1000K|  8089   (0)| 00:00:41 |     1 |    10 |
    |   3 |    TABLE ACCESS FULL| TAB_PART |  1000K|  8089   (0)| 00:00:41 |     1 |    10 |
    | Id  | Operation          | Name       | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |            |     1 |  7659   (0)| 00:00:39 |
    |   1 |  SORT AGGREGATE    |            |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| TAB_NOPART |  1000K|  7659   (0)| 00:00:39 |
    But on my PC the FTS on the non-partitioned table is faster than the FTS on the partitions (1sec to 3 sec.) and v$sesstat shows the reason for this difference:
    -- non partitioned table
    NAME                                               DIFF
    table scan rows gotten                          1000000
    file io wait time                                 15313
    session logical reads                             15156
    physical reads                                    15153
    consistent gets direct                            15152
    physical reads direct                             15152
    DB time                                              95
    -- partitioned table
    NAME                                               DIFF
    file io wait time                               2746493
    table scan rows gotten                          1000000
    session logical reads                             15558
    physical reads                                    15518
    physical reads cache prefetch                     15202
    DB time                                             295
    (maybe my choose of counters is questionable)
    So it's possible to get slower access for an FTS on a partitioned table under special conditions.
    Regards
    Martin

  • How to reduce IO COST???

    Dear All,
    Any one know how to reduce the IO COST?
    Thanks In advance.

    Your question is as generic as it could possibly be, and therefore it's not easy to help you. But in a nutshell, IO can be improved by spreading your tablespaces on different different disk readers/writers (not the correct word I'm sure, but hopefully you understand what I mean). Might be good for example to store your indexes in a different tablespace (disk) than the tables, so that there is not too much contention when using the index and table concurrently for a query. You could also reduce the amount of IO by creating new indexes when FTS against large tables are run (if enough of the rows are filtered out). Sorry, that was a very generic answer to a very generic question.
    Daniel

  • Urgent HELP - How to reduce the number of entries in table MESYBODY?

    Does anyone know how to reduce the number of records in synchronization table MESYBODY and MESYHEAD?  The reason I wanted to reduce these tables is because I believe they have so many duplicated entries that causes extremely slow performance everytime we sync.  Currently, there are almost 50,000 records for approximately 100 users, and I believe it shouldn't be that much. 
    We are running into a problem that it takes approximately 25-30 minutes to sync. 
    Any advices would be highly appreciated.
    Regards,
    Dai

    Hi Dai,
    please try to run the middleware job WAF_MW_MAPPING. For some applications (Mobile Time and Travel for example) this helps to clean the tables.
    Br, alex
    alexander ilg
    http://www.msc-mobile.com

  • How to Reduce Clusetering Factor on Table?

    I am seeing a very high clustering factor on an SDO geometry table in our 10g RAC DB on our Linux boxes. This slow performance is repeateable on othe r Linux as well as Solaris DBs for the same table. Inserts go in at a rate of 44 milliseconds per insert and we only have about 27000 rows in the table. After viewing a VERY slow insert of about 600 records into this same table, I saw the clustering factor in OEM. The clustering factor is nearly identical to the # rows in the table indicating that useability of the index is fairly low now. I have referenced Metalink Tech Note 223117.1 and, while it affirms what I've seen, I am still trying to determine how to reduce the Clustering Factor. The excerpt on how to do this is below:
    "The only method to affect the clustering factor is to sort and then store the rows in the table in the same order as in they appear in the index. Exporting rows and putting them back in the same order that they appeared originally will have no affect. Remember that ordering the rows to suit one index may have detrimental effects on the choice of other indexes."
    Sounds great, but how does one actually go about storing the rows in the table in the same order as they appear in the index?
    We have tried placing our commits after the last insert as well as after every insert and the results are fairly neglible. We also have a column of type SDE.ST_GEOMETRY in the table and are wondering if this might also be an issue. Thanks in advance for any help.
    Matt Sauter

    Joel is right that the clustering factor is going to have absolutely no effect on the speed of inserts. The clustering factor is merely one, purely statistical, factor the optimiser makes use of to determine how to perform a SELECT statement (i.e., do I bother to use this index or not for row retrieval). It's got nothing to do with the efficiency of inserts.
    If I were you, I'd be looking at factors such as excessive disk I/O taking place for other reasons, inadequate buffer cache and/or enqueue and locking issues instead.
    If you're committing after every insert, for example, then redo will have to be flushed (a commit is about the only foreground wait event -i.e., one that you get to experience in real time- that Oracle has, so a commit after every insert's really not a smart idea). If your redo logs are stored on, say, the worst-performing disk you could buy that's also doing duty as a fileserver's main hard disk, then LGWR will be twiddling its thumbs a lot! You say you've tested this, and that's fine... I'm just saying, it's one theoretical possibility in these sorts of situations. You still want to make sure you're not suffering any log writer-related waits, all the same.
    Similarly, if you're performing huge reads on a (perhaps completely separate) table that is causing the buffer cache to be wiped every second or so, then getting access to your table so your inserts can take place could be problematic. Check if you've got any database writer waits, for example: they are usally a good sign of general I/O bottlenecks.
    Finally, you're on a RAC... so if the blocks of the table you're writing to are in memory over on another instance, and they have to be shipped to your instance, you could have high enqueue waits whilst that shipment is taking place. Maybe your interconnect is not up to the job? Maybe it's faulty, even, with significant packet loss along the way? Even worse if someone's decided to switch off cache fusion transfer for the datafiles invoved (for then block shipment happens by writing them to disk in one instance and reading from disk in the other). RAC adds a whole new level of complexity to things, so good luck tracking that lot down!!
    Also, maybe you're using Freelists and Freelist groups rather than ASSM, so perhaps you're fighting for access to the freelist with whatever else is happening on your database at the time...
    You get the idea: this could be a result of activity taking place on the server for reasons completely unconnected with your insert. It could be a feature of Spatial (with which not many people will be familiar, so good luck if so!) It could be a result of the way your RAC is configured. It could be any number of things... but I'd be willing to bet quite a bit that it's got sod-all to do with the clustering factor!
    You'll need to monitor the insert using a tool like Insider or Toad so you can see if waits and so on happen, more or less in real time -or start using the built-in tools like Statspack or AWR to analyze your workload after it's completed- to work out what your best fix is likely to be.

  • How to reduce time for replicating large tables?

    Hi
    Any suggestions on how to reduce the amount of time it takes to replicate a large table when it is first created?
    I have a table with 150 million rows in it, and it takes forever to start the replication process even if I run it in parallel, and I can’t afford the downtime.

    What downtime are you referring to? The primary doesn't need to be down when you're setting up replication and you're presumably still in the process of doing the initial configuration on the replicated database, so it's not really down, it's just not up yet.
    Justin

Maybe you are looking for

  • Arrow buttons missing from the scrollbars!

    Does anyone know of anyway including a third party extension to return arrow buttons to the scrollbrs? Lion has what is a fatal flaw to me. There are no arrow buttons in the scrollbars. Not even an option for them! I am aware of all the other ways to

  • Color Picker mouseover preview

    I am trying to implement a standard color picker control using custom color label/value pairs. When I test the application (very basic at this point) For some, but not all, colors I need to mouseover the color twice in order for the preview swatch to

  • Is there any way to install Win7 64bit onto a partition

    Is there any way to install Win7 64bit onto a partition from a Win7 CD? I have tried bootcamp several times and it won't work. I am running a late 2011 MBP 500gb hd, 2.7ghz i7

  • Display Autonumber from Access Database when click insert button

    I have an application that displays all the customers in my Access database. The primary key is an Autonumber that Access generates. How can I display the autonumber that Access generates when I click my insert new record button?

  • Summary thread: Apps Dead and Music Missing - Restore required for fix

    This is a summary thread, so that we can get this problem noticed by apple. If you are having this problem, please post here so this issue is addressed in only one place. If you find other posts on this matter, please post the link here. Problem: All