How can I improve optimizers poor cardinality estimates?

Hi all,
I have a query that is taking too long and it looks like the cardinality estimates are way off. It seems particulary bas with the hash joins
and I don't know how to get the optimizer to get a better estimate. The tables in the query were last analyzed a couple of weeks ago
using dbms_stats and DBMS_STATS.AUTO_SAMPLE_SIZE and FOR ALL COLUMNS SIZE AUTO but looking at dba_tab_col_statistics there is only a frequency histogram
on a column not used in the query. The data hasn't really changed that much since the last collection
This is 11.2.0.2.1 on linux x86_64.
create table test2 as
select /*+ GATHER_PLAN_STATISTICS */ DISTINCT
hts.resource_id resource_id,       
a.start_time start_date,
hta.attribute12 alias1
FROM
hxc_time_attribute_usages htu,
hxc_time_attributes hta,       
hxc_time_building_blocks a,
hxc_time_building_blocks b,       
hxc_time_building_blocks c,
hxc_timecard_summary hts 
WHERE    
htu.time_attribute_id = hta.time_attribute_id       
AND hta.attribute_category LIKE 'ELEMENT%'
AND hta.attribute12 IS NOT NULL       
AND htu.time_building_block_id = c.time_building_block_id       
AND a.time_building_block_id = b.parent_building_block_id       
AND b.time_building_block_id = c.parent_building_block_id       
AND c.time_building_block_id = htu.time_building_block_id       
AND a.scope = 'TIMECARD'       
AND b.scope = 'DAY'       
AND c.scope ='DETAIL'      
AND hts.timecard_id = a.time_building_block_id
Plan hash value: 1730726592
| Id  | Operation                          | Name                      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  | Writes |  OMem |  1Mem | Used-Mem | Used-Tmp|
|   0 | CREATE TABLE STATEMENT             |                           |      1 |        |      0 |00:40:13.79 |     621K|   3182K|   2671K|       |       |          |         |
|   1 |  LOAD AS SELECT                    |                           |      1 |        |      0 |00:40:13.79 |     621K|   3182K|   2671K|   529K|   529K|  529K (0)|         |
|   2 |   SORT UNIQUE                      |                           |      1 |   1205 |    170K|00:40:13.37 |     618K|   3182K|   2671K|    11M|    11M|   10M (0)|         |
|*  3 |    HASH JOIN                       |                           |      1 |   1205 |    135M|00:36:59.88 |     618K|   3182K|   2671K|  3325M|    63M|  371M (1)|      18M|
|*  4 |     HASH JOIN                      |                           |      1 |  10829 |    143M|00:11:47.18 |     616K|    894K|    384K|  2047M|    32M|  539M (1)|    2748K|
|*  5 |      HASH JOIN                     |                           |      1 |   9541 |     28M|00:06:43.60 |     500K|    448K|  54765 |   751M|    16M|  607M (1)|     456K|
|*  6 |       HASH JOIN                    |                           |      1 |   8885 |   7561K|00:05:28.13 |     383K|    276K|      0 |   211M|  8846K|  278M (0)|         |
|*  7 |        HASH JOIN                   |                           |      1 |  21193 |   2689K|00:05:00.55 |     266K|    160K|      0 |   169M|  9302K|  201M (0)|         |
|*  8 |         TABLE ACCESS BY INDEX ROWID| HXC_TIME_ATTRIBUTES       |      1 |  20971 |   2637K|00:04:23.04 |     209K|    103K|      0 |       |       |          |         |
|*  9 |          INDEX RANGE SCAN          | HXC_TIME_ATTRIBUTES_FK2   |      1 |  71213 |   2640K|00:01:25.09 |   15774 |  15764 |      0 |       |       |          |         |
|  10 |         TABLE ACCESS FULL          | HXC_TIME_ATTRIBUTE_USAGES |      1 |   8451K|   8849K|00:00:08.71 |   56898 |  56825 |      0 |       |       |          |         |
|* 11 |        TABLE ACCESS FULL           | HXC_TIME_BUILDING_BLOCKS  |      1 |   1094K|   2703K|00:00:08.01 |     116K|    116K|      0 |       |       |          |         |
|* 12 |       TABLE ACCESS FULL            | HXC_TIME_BUILDING_BLOCKS  |      1 |   1094K|   3025K|00:00:13.12 |     116K|    116K|      0 |       |       |          |         |
|* 13 |      TABLE ACCESS FULL             | HXC_TIME_BUILDING_BLOCKS  |      1 |   1206K|    284K|00:00:19.24 |     116K|    116K|      0 |       |       |          |         |
|  14 |     TABLE ACCESS FULL              | HXC_TIMECARD_SUMMARY      |      1 |    118K|    124K|00:00:05.15 |    2212 |   1183 |      0 |       |       |          |         |
Predicate Information (identified by operation id):
   3 - access("HTS"."TIMECARD_ID"="A"."TIME_BUILDING_BLOCK_ID")
   4 - access("A"."TIME_BUILDING_BLOCK_ID"="B"."PARENT_BUILDING_BLOCK_ID")
   5 - access("B"."TIME_BUILDING_BLOCK_ID"="C"."PARENT_BUILDING_BLOCK_ID")
   6 - access("HTU"."TIME_BUILDING_BLOCK_ID"="C"."TIME_BUILDING_BLOCK_ID")
   7 - access("HTU"."TIME_ATTRIBUTE_ID"="HTA"."TIME_ATTRIBUTE_ID")
   8 - filter("HTA"."ATTRIBUTE12" IS NOT NULL)
   9 - access("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
       filter("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
  11 - filter(("C"."SCOPE"='DETAIL' AND "C"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  12 - filter(("B"."SCOPE"='DAY' AND "B"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  13 - filter("A"."SCOPE"='TIMECARD')I can get a slight improvement if I set optimizer_dynamic_sampling=4
Plan hash value: 2768898101
| Id  | Operation                      | Name                      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  | Writes |  OMem |  1Mem | Used-Mem | Used-Tmp|
|   0 | CREATE TABLE STATEMENT         |                           |      1 |        |      0 |00:20:21.47 |     621K|    760K|    355K|       |       |          |         |
|   1 |  LOAD AS SELECT                |                           |      1 |        |      0 |00:20:21.47 |     621K|    760K|    355K|   529K|   529K|  529K (0)|         |
|   2 |   SORT UNIQUE                  |                           |      1 |    433K|    170K|00:20:21.07 |     618K|    760K|    354K|    11M|    11M|   10M (0)|         |
|*  3 |    HASH JOIN                   |                           |      1 |    433K|    135M|00:17:36.89 |     618K|    760K|    354K|   171M|  9261K|  233M (0)|         |
|*  4 |     TABLE ACCESS BY INDEX ROWID| HXC_TIME_ATTRIBUTES       |      1 |   2509K|   2637K|00:00:06.33 |     209K|      0 |      0 |       |       |          |         |
|*  5 |      INDEX RANGE SCAN          | HXC_TIME_ATTRIBUTES_FK2   |      1 |  71213 |   2640K|00:00:02.17 |   15767 |      0 |      0 |       |       |          |         |
|*  6 |     HASH JOIN                  |                           |      1 |   1444K|    272M|00:07:38.99 |     409K|    760K|    354K|  2047M|    32M|  546M (1)|    2717K|
|*  7 |      HASH JOIN                 |                           |      1 |    446K|     30M|00:01:43.68 |     352K|    399K|  50235 |   639M|    17M|  694M (1)|     418K|
|*  8 |       HASH JOIN                |                           |      1 |    377K|   8329K|00:00:41.18 |     235K|    232K|      0 |    17M|  2383K|   27M (0)|         |
|*  9 |        HASH JOIN               |                           |      1 |    134K|    277K|00:00:23.28 |     118K|    116K|      0 |  4912K|  1573K| 7759K (0)|         |
|  10 |         TABLE ACCESS FULL      | HXC_TIMECARD_SUMMARY      |      1 |    118K|    124K|00:00:00.08 |    2212 |      0 |      0 |       |       |          |         |
|* 11 |         TABLE ACCESS FULL      | HXC_TIME_BUILDING_BLOCKS  |      1 |   1206K|    284K|00:00:22.13 |     116K|    116K|      0 |       |       |          |         |
|* 12 |        TABLE ACCESS FULL       | HXC_TIME_BUILDING_BLOCKS  |      1 |   2988K|   3025K|00:00:05.05 |     116K|    116K|      0 |       |       |          |         |
|* 13 |       TABLE ACCESS FULL        | HXC_TIME_BUILDING_BLOCKS  |      1 |   2514K|   2703K|00:00:03.65 |     116K|    116K|      0 |       |       |          |         |
|  14 |      TABLE ACCESS FULL         | HXC_TIME_ATTRIBUTE_USAGES |      1 |   8451K|   8849K|00:00:08.23 |   56898 |  56818 |      0 |       |       |          |         |
Predicate Information (identified by operation id):
   3 - access("HTU"."TIME_ATTRIBUTE_ID"="HTA"."TIME_ATTRIBUTE_ID")
   4 - filter("HTA"."ATTRIBUTE12" IS NOT NULL)
   5 - access("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
       filter("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
   6 - access("HTU"."TIME_BUILDING_BLOCK_ID"="C"."TIME_BUILDING_BLOCK_ID")
   7 - access("B"."TIME_BUILDING_BLOCK_ID"="C"."PARENT_BUILDING_BLOCK_ID")
   8 - access("A"."TIME_BUILDING_BLOCK_ID"="B"."PARENT_BUILDING_BLOCK_ID")
   9 - access("HTS"."TIMECARD_ID"="A"."TIME_BUILDING_BLOCK_ID")
  11 - filter("A"."SCOPE"='TIMECARD')
  12 - filter(("B"."SCOPE"='DAY' AND "B"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  13 - filter(("C"."SCOPE"='DETAIL' AND "C"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
Note
   - dynamic sampling used for this statement (level=4)But I still have a large difference in the Estimated and Actual, what can I do to help the optimizer get a better estimate?

Hi Dom
Thank you for your input it is always appreciated!
I tried running with a manual workarea and a sort_area_size of 2000000000 but the result was worse then before.
Plan hash value: 1730726592
| Id  | Operation                          | Name                      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  | Writes |  OMem |  1Mem | Used-Mem | Used-Tmp|
|   0 | CREATE TABLE STATEMENT             |                           |      1 |        |      0 |00:36:15.63 |    1085K|   2926K|   2475K|       |       |          |         |
|   1 |  LOAD AS SELECT                    |                           |      1 |        |      0 |00:36:15.63 |    1085K|   2926K|   2475K|   529K|   529K|  529K (0)|         |
|   2 |   SORT UNIQUE                      |                           |      1 |   1205 |    170K|00:36:14.83 |    1083K|   2926K|   2475K|    11M|    11M|   10M (0)|         |
|*  3 |    HASH JOIN                       |                           |      1 |   1205 |    135M|00:32:54.89 |    1083K|   2926K|   2475K|  3325M|    63M| 2048M (1)|      19M|
|*  4 |     HASH JOIN                      |                           |      1 |  10829 |    143M|01:06:20.59 |     651K|    623K|    188K|  2047M|    32M| 2048M (1)|    1681K|
|*  5 |      HASH JOIN                     |                           |      1 |   9541 |     28M|00:05:51.56 |     500K|    317K|      0 |   751M|    16M| 1088M (0)|         |
|*  6 |       HASH JOIN                    |                           |      1 |   8885 |   7561K|00:03:03.10 |     383K|    201K|      0 |   211M|  8846K|  379M (0)|         |
|*  7 |        HASH JOIN                   |                           |      1 |  21193 |   2689K|00:02:21.61 |     266K|  84965 |      0 |   169M|  9302K|  299M (0)|         |
|*  8 |         TABLE ACCESS BY INDEX ROWID| HXC_TIME_ATTRIBUTES       |      1 |  20971 |   2637K|00:01:45.51 |     209K|  28147 |      0 |       |       |          |         |
|*  9 |          INDEX RANGE SCAN          | HXC_TIME_ATTRIBUTES_FK2   |      1 |  71213 |   2640K|00:00:43.17 |   15769 |   6921 |      0 |       |       |          |         |
|  10 |         TABLE ACCESS FULL          | HXC_TIME_ATTRIBUTE_USAGES |      1 |   8451K|   8849K|00:00:08.75 |   56898 |  56818 |      0 |       |       |          |         |
|* 11 |        TABLE ACCESS FULL           | HXC_TIME_BUILDING_BLOCKS  |      1 |   1094K|   2703K|00:00:22.74 |     116K|    116K|      0 |       |       |          |         |
|* 12 |       TABLE ACCESS FULL            | HXC_TIME_BUILDING_BLOCKS  |      1 |   1094K|   3025K|00:00:07.85 |     116K|    116K|      0 |       |       |          |         |
|* 13 |      TABLE ACCESS FULL             | HXC_TIME_BUILDING_BLOCKS  |      1 |   1206K|    284K|00:00:07.42 |     117K|    116K|      0 |       |       |          |         |
|  14 |     TABLE ACCESS FULL              | HXC_TIMECARD_SUMMARY      |      1 |    118K|    124K|00:00:01.57 |    2250 |    282 |      0 |       |       |          |         |
Query Block Name / Object Alias (identified by operation id):
   1 - SEL$1
   8 - SEL$1 / HTA@SEL$1
   9 - SEL$1 / HTA@SEL$1
  10 - SEL$1 / HTU@SEL$1
  11 - SEL$1 / C@SEL$1
  12 - SEL$1 / B@SEL$1
  13 - SEL$1 / A@SEL$1
  14 - SEL$1 / HTS@SEL$1
Predicate Information (identified by operation id):
   3 - access("HTS"."TIMECARD_ID"="A"."TIME_BUILDING_BLOCK_ID")
   4 - access("A"."TIME_BUILDING_BLOCK_ID"="B"."PARENT_BUILDING_BLOCK_ID")
   5 - access("B"."TIME_BUILDING_BLOCK_ID"="C"."PARENT_BUILDING_BLOCK_ID")
   6 - access("HTU"."TIME_BUILDING_BLOCK_ID"="C"."TIME_BUILDING_BLOCK_ID")
   7 - access("HTU"."TIME_ATTRIBUTE_ID"="HTA"."TIME_ATTRIBUTE_ID")
   8 - filter("HTA"."ATTRIBUTE12" IS NOT NULL)
   9 - access("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
       filter("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
  11 - filter(("C"."SCOPE"='DETAIL' AND "C"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  12 - filter(("B"."SCOPE"='DAY' AND "B"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  13 - filter("A"."SCOPE"='TIMECARD')
66 rows selected.So I tried setting some cardinality hints, but again, it doesn;t seemd to have helped.
select /*+ GATHER_PLAN_STATISTICS
CARDINALITY(A@SEL$1 284000)
CARDINALITY(HTA@SEL$1 2637000)
CARDINALITY(C@SEL$1 270000)
CARDINALITY(B@SEL$1 300000) */
DISTINCT
hts.resource_id resource_id,       
a.start_time start_date,
hta.attribute12 alias1  
FROM hxc_time_attribute_usages htu,
hxc_time_attributes hta,       
hxc_time_building_blocks a,
hxc_time_building_blocks b,       
hxc_time_building_blocks c,
hxc_timecard_summary hts 
WHERE    
htu.time_attribute_id =hta.time_attribute_id       
AND hta.attribute_category LIKE 'ELEMENT%'
AND hta.attribute12 IS NOT NULL       
AND htu.time_building_block_id = c.time_building_block_id       
AND a.time_building_block_id = b.parent_building_block_id       
AND b.time_building_block_id = c.parent_building_block_id       
AND c.time_building_block_id = htu.time_building_block_id       
AND a.scope = 'TIMECARD'       
AND b.scope = 'DAY'       
AND c.scope ='DETAIL'        AND hts
Plan hash value: 1839838244
| Id  | Operation                      | Name                      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  | Writes |  OMem |  1Mem | Used-Mem | Used-Tmp|
|   0 | CREATE TABLE STATEMENT         |                           |      1 |        |      0 |00:18:00.46 |    1104K|   4415K|   3927K|       |       |       |          |
|   1 |  LOAD AS SELECT                |                           |      1 |        |      0 |00:18:00.46 |    1104K|   4415K|   3927K|   529K|   529K|  529K (0)|       |
|   2 |   SORT UNIQUE                  |                           |      1 |   9678 |    170K|00:17:59.95 |    1101K|   4415K|   3926K|    11M|    11M|   10M (0)|       |
|*  3 |    HASH JOIN                   |                           |      1 |   9678 |    135M|01:02:43.31 |    1101K|   4415K|   3926K|  4318M|    98M|  305M (1)|    27M|
|*  4 |     HASH JOIN                  |                           |      1 |  30691 |    272M|00:12:31.27 |     409K|   1009K|    602K|  2047M|    32M|  498M (1)|    2523K|
|*  5 |      HASH JOIN                 |                           |      1 |   9485 |     30M|00:05:41.24 |     352K|    649K|    300K|  2047M|    33M|  461M (1)|    2355K|
|*  6 |       HASH JOIN                |                           |      1 |  22123 |     31M|00:01:56.55 |     349K|    367K|  17535 |   493M|    18M|  661M (1)|   146K|
|*  7 |        HASH JOIN               |                           |      1 |  79434 |   8102K|00:00:53.71 |     233K|    233K|      0 |   116M|    10M|  195M (0)|       |
|*  8 |         TABLE ACCESS FULL      | HXC_TIME_BUILDING_BLOCKS  |      1 |    270K|   2703K|00:00:24.01 |     116K|    116K|      0 |       |       |
|*  9 |         TABLE ACCESS FULL      | HXC_TIME_BUILDING_BLOCKS  |      1 |    300K|   3025K|00:00:10.42 |     116K|    116K|      0 |       |       |       |          |
|* 10 |        TABLE ACCESS FULL       | HXC_TIME_BUILDING_BLOCKS  |      1 |    284K|    284K|00:00:11.44 |     116K|    116K|      0 |       |       |       |          |
|  11 |       TABLE ACCESS FULL        | HXC_TIMECARD_SUMMARY      |      1 |    118K|    124K|00:00:01.88 |    2212 |    256 |      0 |       |       |       |          |
|  12 |      TABLE ACCESS FULL         | HXC_TIME_ATTRIBUTE_USAGES |      1 |   8451K|   8849K|00:00:11.09 |   56898 |  56818 |      0 |       |       |       |          |
|* 13 |     TABLE ACCESS BY INDEX ROWID| HXC_TIME_ATTRIBUTES       |      1 |   2637K|   2637K|00:03:20.70 |     210K|  56613 |      0 |       |       |       |          |
|* 14 |      INDEX RANGE SCAN          | HXC_TIME_ATTRIBUTES_FK2   |      1 |  71213 |   2640K|00:01:34.62 |   16142 |  15527 |      0 |       |       |       |          |
Query Block Name / Object Alias (identified by operation id):
   1 - SEL$1
   8 - SEL$1 / C@SEL$1
   9 - SEL$1 / B@SEL$1
  10 - SEL$1 / A@SEL$1
  11 - SEL$1 / HTS@SEL$1
  12 - SEL$1 / HTU@SEL$1
  13 - SEL$1 / HTA@SEL$1
  14 - SEL$1 / HTA@SEL$1
Predicate Information (identified by operation id):
   3 - access("HTU"."TIME_ATTRIBUTE_ID"="HTA"."TIME_ATTRIBUTE_ID")
   4 - access("HTU"."TIME_BUILDING_BLOCK_ID"="C"."TIME_BUILDING_BLOCK_ID")
   5 - access("HTS"."TIMECARD_ID"="A"."TIME_BUILDING_BLOCK_ID")
   6 - access("A"."TIME_BUILDING_BLOCK_ID"="B"."PARENT_BUILDING_BLOCK_ID")
   7 - access("B"."TIME_BUILDING_BLOCK_ID"="C"."PARENT_BUILDING_BLOCK_ID")
   8 - filter(("C"."SCOPE"='DETAIL' AND "C"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
   9 - filter(("B"."SCOPE"='DAY' AND "B"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL))
  10 - filter("A"."SCOPE"='TIMECARD')
  13 - filter("HTA"."ATTRIBUTE12" IS NOT NULL)
  14 - access("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
       filter("HTA"."ATTRIBUTE_CATEGORY" LIKE 'ELEMENT%')
68 rows selected.
SQL>What else do you think I should try, or did I do the cardinality bit wrong, because I don't seem to be able to hint the HASH Join, only the table scan?
Thanks

Similar Messages

  • How can i improve burning quality of dvd.looks fine in preview on idvd,but final burn quality is poor/

    how can i improve burning quality of dvd.looks fine in preview on idvd,but final burn quality is poor.

    Had same problem with iPhoto pictures and poor burn quality. Went back to original picture file and dragged images into idvd project from there. Set encoding at professional quality and burned at slowest speed. Got very good result with high quality slideshow when played on TV.
    Also tried Old Toad's Aug 30, 2011 advice to get a slideshow into iDVD with transitions, music, etc. from iPhoto.
    Again the quaility of the burned CD was very good. 

  • Finally upgraded to Lions OSX. The Mac screen is now hard to view as everything has a grey tinge. How can I improve this? Tried

    Finally took the plungs and upgraded to Lion OSx so that I could access icloud. Everything worked ok but I now find it difficult to view the screen. Everything has a grey tinge and with my poor eyesight it's really frustrating. Zooming in is ok but I would really like more contrast. What was wrong with crisp white and deep black? Have tried to change the profiles in System Preferences but it's confusing to follow and after 3 attempts I still don't like any of the profiles. My photos all have an unnatural colour now. How can I improve this and bring everything back to 'normal'? Whose 'bright' (?) idea was it to make everyting grey and why???

    Thanks. Very helpful. It's now less of a strain for me. But the fonts are still too pale. I really need to be able to read words that are black. In Mail, the sender and headings are dark enough, but the content is still too light for me to read without straining. Any other suggestions?

  • How can I improve below SQL performance.

    Hi,
    How can I improve below SQL performance. This SQL consumes CPU and occures wait events. It is running every 10 seconds. When I look at the session information from Enterprise Manager I can see that "Histogram for Wait Event: PX Deq Credit: send blkd"
    I created some indexes. I heard that the indexes are not used when there is a NULL but when I checked the xecution plan It uses index.
    SELECT i.ID
    FROM EXPRESS.invoices i
    WHERE i.nbr IS NOT NULL
    AND i.EXTRACT_BATCH IS NULL
    AND i.SUB_TYPE='COD'
    Explain Plan from Toad
    SELECT STATEMENT CHOOSECost: 77 Bytes: 6,98 Cardinality: 349                     
         4 PX COORDINATOR                
              3 PX SEND QC (RANDOM) SYS.:TQ10000 Cost: 77 Bytes: 6,98 Cardinality: 349           
                   2 PX BLOCK ITERATOR Cost: 77 Bytes: 6,98 Cardinality: 349      
                        1 INDEX FAST FULL SCAN INDEX EXPRESS.INVC_TRANS_INDX Cost: 77 Bytes: 6,98 Cardinality: 349
    Execution Plan from Sqlplus
    | Id | Operation | Name | Rows | Bytes | Cost | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 349 | 6980 | 77 | | | |
    | 1 | PX COORDINATOR | | | | | | | |
    | 2 | PX SEND QC (RANDOM) | :TQ10000 | 349 | 6980 | 77 | Q1,00 | P->S | QC (RAND) |
    | 3 | PX BLOCK ITERATOR | | 349 | 6980 | 77 | Q1,00 | PCWC | |
    |* 4 | INDEX FAST FULL SCAN| INVC_TRANS_INDX | 349 | 6980 | 77 | Q1,00 | PCWP | |
    Predicate Information (identified by operation id):
    4 - filter("I"."NBR" IS NOT NULL AND "I"."EXTRACT_BATCH" IS NULL AND "I"."SUB_TYPE"='COD')
    Note
    - 'PLAN_TABLE' is old version
    - cpu costing is off (consider enabling it)
    Statistics
    141 recursive calls
    0 db block gets
    5568 consistent gets
    0 physical reads
    0 redo size
    319 bytes sent via SQL*Net to client
    458 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    0 rows processed
    Instance Efficiency Percentages (Target 100%)
    Buffer Nowait %: 100.00
    Redo NoWait %: 100.00
    Buffer Hit %: 99.70
    In-memory Sort %: 100.00
    Library Hit %: 99.81
    Soft Parse %: 99.77
    Execute to Parse %: 63.56
    Latch Hit %: 90.07
    Parse CPU to Parse Elapsd %: 0.81
    % Non-Parse CPU: 98.88
    Top 5 Timed Events                         
    Event     Waits     Time(s)     Avg Wait(ms)     % Total Call Time     Wait Class
    latch: library cache     12,626     16,757     1,327     62.6     Concurrency
    CPU time          5,712          21.Mar     
    latch: session allocation     1,848,987     1,99     1     07.Nis     Other
    PX Deq Credit: send blkd     1,242,265     981     1     03.Tem     Other
    PX qref latch     1,405,819     726     1     02.Tem     Other
    The database version is 10.2.0.1 but we haven't installed the patch 10.2.0.5. yet.
    I am waiting your comments.
    Thanks in advance

    Welcome to the forum.
    I created some indexes. I heard that the indexes are not used when there is a NULL but when I checked the xecution plan It uses index. What columns are indexed?
    And what do:
    select i.sub_type
    ,      count(*)
    from   express.invoices i
    where  i.nbr is not null
    and    i.extract_batch is null
    group by i.sub_type; and
    select i.sub_type
    ,      count(*)
    from   express.invoices i
    group by i.sub_type; return?
    Also, try use the {noformat}{noformat} tag when posting examples/execution plans etc.
    See: HOW TO: Post a SQL statement tuning request - template posting for more tuning instructions.
    It'll make a big difference:
    SELECT i.ID
    FROM EXPRESS.invoices i
    WHERE i.nbr IS NOT NULL
    AND i.EXTRACT_BATCH IS NULL
    AND i.SUB_TYPE='COD'
    Explain Plan from Toad
    SELECT STATEMENT CHOOSECost: 77 Bytes: 6,98 Cardinality: 349                     
         4 PX COORDINATOR                
              3 PX SEND QC (RANDOM) SYS.:TQ10000 Cost: 77 Bytes: 6,98 Cardinality: 349           
                   2 PX BLOCK ITERATOR Cost: 77 Bytes: 6,98 Cardinality: 349      
                        1 INDEX FAST FULL SCAN INDEX EXPRESS.INVC_TRANS_INDX Cost: 77 Bytes: 6,98 Cardinality: 349
    Execution Plan from Sqlplus
    | Id | Operation | Name | Rows | Bytes | Cost | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 349 | 6980 | 77 | | | |
    | 1 | PX COORDINATOR | | | | | | | |
    | 2 | PX SEND QC (RANDOM) | :TQ10000 | 349 | 6980 | 77 | Q1,00 | P->S | QC (RAND) |
    | 3 | PX BLOCK ITERATOR | | 349 | 6980 | 77 | Q1,00 | PCWC | |
    |* 4 | INDEX FAST FULL SCAN| INVC_TRANS_INDX | 349 | 6980 | 77 | Q1,00 | PCWP | |
    Predicate Information (identified by operation id):
    4 - filter("I"."NBR" IS NOT NULL AND "I"."EXTRACT_BATCH" IS NULL AND "I"."SUB_TYPE"='COD')
    Note
    - 'PLAN_TABLE' is old version
    - cpu costing is off (consider enabling it)
    Statistics
    141 recursive calls
    0 db block gets
    5568 consistent gets
    0 physical reads
    0 redo size
    319 bytes sent via SQL*Net to client
    458 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    0 rows processed
    Instance Efficiency Percentages (Target 100%)
    Buffer Nowait %: 100.00
    Redo NoWait %: 100.00
    Buffer Hit %: 99.70
    In-memory Sort %: 100.00
    Library Hit %: 99.81
    Soft Parse %: 99.77
    Execute to Parse %: 63.56
    Latch Hit %: 90.07
    Parse CPU to Parse Elapsd %: 0.81
    % Non-Parse CPU: 98.88
    Top 5 Timed Events                         
    Event     Waits     Time(s)     Avg Wait(ms)     % Total Call Time     Wait Class
    latch: library cache     12,626     16,757     1,327     62.6     Concurrency
    CPU time          5,712          21.Mar     
    latch: session allocation     1,848,987     1,99     1     07.Nis     Other
    PX Deq Credit: send blkd     1,242,265     981     1     03.Tem     Other
    PX qref latch     1,405,819     726     1     02.Tem     Other

  • How can we improve Apple service?

    Well meaning Apple staff are being disempowered by the rigid customer architecture and poor customer support systems. How can we help Apple become more customer focused before it losses its long time brand advocates?

    P ~ Welcome to the Support Communities.
    pfoley_Aus wrote:
    How can we improve Apple service? (...) How can we help Apple...?
    Send feedback. ...Regarding your experiences at the Apple Store, use this form:
    http://www.apple.com/retail/feedback/
    And there are more feedback categories at lower right of this page:
    http://www.apple.com/contact/

  • How can I improve the stability of itunes64bit 8.0.2 on my Vista system?

    Vista Home Premium: iTunes64bit: application crashes after adding album photos and then changing views (list, Album, split) or clicking on different playlists and back to the entire music library.
    The library has 42,000 items (mostly music) so it is quite large. At launch it takes a long time for itunes to load and display. There is no user cues telling me it is running. It simply displays after 60 or more seconds.
    Then I start working in the library, pasting pictures to multiple items, modifying album titles.
    After doing a few management tasks on my music items and navigating back and forth between the music library and playlist (changing views), the application stop being responsive and according to the log, the app just plainly crashes.
    Sometimes I can restart successfully but most of the times, I need to stop the itunes service or log-out before I can restart it successfully.
    I am using itunes64bit 8.0.2
    I am running it on a machine equipped with 4GB of ram and the library lives on a 500GB external hard drive plugged-in through USB 2.0.
    How can I improve the stability of itunes64bit on my system?
    Message was edited by: JF Boisvert

    This VI can be convert to labview 8.0 because subvi are not compatible with old version.
    I post a screenshot.
    Aurélien J.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe...
    Attachments:
    image.jpg ‏38 KB

  • How can I improve quality of image when burning a movie to a DVD

    How can I improve quality of image when burning a movie to a DVD?

    What resolution are you using?  If the DVD is to be playable on an ordinary DVD player, only ordinary TV resolution is supported.  You need Blue ray for HD.
    Geoff.

  • How can I flip my iphone videos on my PC? My videos from my iphone are horrible when I transfer them to my PC. How can I improve the video on my PC? Can I just convert the files to WMV? When the video plays the speed is off, it's half slow-motion

    My videos from my iphone are horrible when I transfer them to my PC. How can I improve the video on my PC? Can I just convert the files to WMV? When the video plays the speed is off, it's half slow-motion and staggers into normal play. The clips are slightly cut as well, the clips do not roll continuously.  I'm taling about videos that are no more than 2 minutes long.  I'm frustrated and I could really use some advice-my kids basketball games is what I'm recording and I'm trying to send them to my family (they are not very tech savvy). Thanks

    Not it's only function but one for which it was most admirably suited, which is why I really hope someone can find a work around. I am hoping my post to the Apple feedback may prompt a useful response from Apple and I live in hope that my post here will elicit a useful response from another user. I did not miss the the text at the top of the feedback form but you presumably missed my initial text, 'someone here can explain' or my subsequent 'work around from another user'
    Just in case anyone reading this has a large collection of music videos, video podcasts or iTunes U then DO NOT upgrade your iPad to iOS 5. If you are considering purchasing the iPad as a useful mobile device to experience these media organised in your iTunes please don't as you will be wasting your money. (unless someone on this forum knows of a way to undo the mess created by those infallible folks at Apple)
    Yes I know it does other things but the purpose I bought it for doesn't work anymore

  • How Can we improve the report performance..?

    Hi exports,
    I am learning the Business Objects XIR2, Please let me know How Can we improve the report performance..?
    Please give the answer in detailed way.

    First find out why your report is performing slowly. Then fix it.
    That sounds silly, but there's really no single-path process for improving report performance. You might find issues with the report. With the network. With the universe. With the database. With the database design. With the query definition. With report variables. With the ETL. Once you figure out where the problem is, then you start fixing it. Fixing one problem may very well reveal another. I spent two years working on a project where we touched every single aspect of reporting (from data collection through ETL and all the way to report delivery) at some point or another.
    I feel like your question is a bit broad (meaning too generic) to address as you have phrased it. Even some of the suggestions already given...
    Array fetch size - this determines the number of rows fetched at a single pass. You really don't need to modify this unless your network is giving issues. I have seen folks suggest setting this to one (which results in a lot of network requests) or 500 (which results in fewer requests but they're much MUCH larger). Does either improve performance? They might, or they might make it worse. Without understanding how your network traffic is managed it's hard to say.
    Shortcut joins? Sure, they can help, as long as they are appropriate. [Many times they are not.|http://www.dagira.com/2010/05/27/everything-about-shortcut-joins/]
    And I could go on and on. The bottom line is that performance tuning doesn't typically fall into a "cookie cutter" approach. It would be better to have a specific question.

  • How can i improve a performence of query

    How can i improve performence of query which not having the where clause for a table

    whenever the query have the where clause then only it can use the indexes
    otherwise how it can use the index eventhough we create the index of that table columns.

  • How can I improve download speed

    How can I improve download speed of movies purchased from iTunes on my AppleTV? 10 hours+ minimum. I've already selected a lower video resolution from the settings in the iTunes store.   It used to be way faster. Any suggestions?  Thanks.

    Check the Internet speed to confirm it is what it is supposed to be by going to www.speedtest.net
    On the ATV, try Settings > General > Reset.
    Power cycle the router, modem, and the ATV

  • How can i improve jsf application? It eat a lot of  CPU.

    I use only request beans, state save method is server.
    How can I improve it, what is with state manager, save state tree.?

    Profile your application and find the CPU hotspots. Then you can figure out what needs improvement.

  • How can I improve speed on iMovie?

    How can I improve speed on iMovie?

    Hello jaquade,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iMovie: Tips to improve performance
    http://support.apple.com/kb/TA27648?viewlocale=en_US
    Best of luck,
    Mario

  • HT1651 how can i improve my macbook's performance without installing memory

    how can i improve my macbook's performance without installing memory

    More RAM & bigger faster Hard Drive will help, maybe a better Graphics card also, since 10.5 ises the Video much harder.
    At the Apple Icon at top left>About this Mac.
    Then click on More Info>Hardware and report this upto *but not including the Serial#*...
    Hardware Overview:
    Machine Name: Power Mac G5 Quad
    Machine Model: PowerMac11,2
    CPU Type: PowerPC G5 (1.1)
    Number Of CPUs: 4
    CPU Speed: 2.5 GHz
    L2 Cache (per CPU): 1 MB
    Memory: 10 GB
    Bus Speed: 1.25 GHz
    Boot ROM Version: 5.2.7f1
    Then click on More Info>Hardware>Graphics/Displays and report like this...
    NVIDIA GeForce 7800GT:
      Chipset Model:          GeForce 7800GT
      Type:          Display
      Bus:          PCI
      Slot:          SLOT-1
      VRAM (Total):          256 MB
      Vendor:          nVIDIA (0x10de)
      Device ID:          0x0092
      Revision ID:          0x00a1
      ROM Revision:          2152.2
      Displays:
    VGA Display:
      Resolution:          1920 x 1080 @ 60 Hz
      Depth:          32-bit Color
      Core Image:          Supported
      Main Display:          Yes
      Mirror:          Off
      Online:          Yes
      Quartz Extreme:          Supported
    Display:
      Status:          No display connected

  • How can I improve my phone signal most of the time I have no service

    How can I improve my signal - my old android phone had a brilliant signal however more often than not I have no signal on the iphone

    Like Peter said, attitude doesn't help, we need all the information possible to construct a picture of whats going on. Plus, the number of people here to help that are from the UK is limited, so chill out, drink some tea, have a scone and then lets talk
    Anyways, since you're in Europe, are you using a provider that uses EE's towers? or EE themselves?
    I ask because some MVNO providers are only licensed to use one spectrum. I know this because of the provider 3/Three. Coming from a stay Austria, I can use any 3 partner network but only on 3G, not LTE, 4G, or GSM.
    But since it's a service issue, talk to your provider accordingly. Ask them what frequency bands are coming from the tower you're nearest to, or you can check it out yourself with the Field Test Mode.
    http://lifehacker.com/5929546/see-the-actual-signal-strength-on-your-iphone-with -this-quick-tweak
    I hope this helps!
    Cheers!

Maybe you are looking for