Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> 10g CBO and how to determine cardinality on INDEX_FFS?
dear all,
I'm trying to determine how the 10g optimizer calculates the
cardinality and/or cost
for an index fast full scan. I do have Jonathan Lewis's latest
book, but I haven't
had a chance to really dig into it, and to make matters worse his
test are so controlled and
as he mentioned little things can change how the optimizer
behaves...so I thought I'd get some
help here.
My environment:
SQL>@10053.sql - turn on 10053 tracing..
SQL> explain plan for SELECT count(*)
from LINK_427037565 where product_id=430657811;
The execution plan in the 10053 trace file reads <PRE>
| SELECT STATEMENT | | | | 2335 | | SORT AGGREGATE | | 1 | 7 | | | INDEX FAST FULL SCAN | LINK_427037565_PUC_U | 6614K | 45M |2335 |
Here is what's in my sys.aux_stats$;
CPUSPEEDNW=> 203.526389537599
IOSEEKTIM => 10
IOTFRSPEED => 4096
SREADTIM => 4.245 MREADTIM => 26.806 CPUSPEED => 198 MBRC => 125 MAXTHR => 4876288 SLAVETHR => NULL
Here is the relevant information from the 10053 trace file.
Size: 7 NDV: 2 Nulls: 0 Density: 5.1457e-08
Histogram: Freq #Bkts: 2 UncompBkts: 1943369 EndPtVals: 2
TABLE: LINK_427037565 Alias: LINK_427037565
Original Card: 9716845 Rounded: 6772595 Computed: 6772595.00
Non Adjusted: 6772595.00
Access Path: table-scan Resc: 6070 Resp: 6070
Access Path: index (index-ffs)
Index: LINK_427037565_PUC_U
rsc_cpu: 281652952 rsc_io: 2000
ix_sel: 0.0000e+00 ix_sel_with_filters: 1.0000e+00
Access Path: index-ffs Resc: 2335 Resp: 2335
Access Path: index (index-only)
Index: LINK_427037565_PUC_U rsc_cpu: 1572700179 rsc_io: 27569 ix_sel: 6.9700e-01 ix_sel_with_filters: 6.9700e-01Access Path: index (skip-scan)
Index: LINK_427037565_PUC_U rsc_cpu: 1572700179 rsc_io: 27569 ix_sel: 6.9700e-01 ix_sel_with_filters: 6.9700e-01 SORT resource Sort statistics Sort width: 448 Area size: 1048576 Max Area size: 78643200 Degree: 1 Blocks to Sort: 17413 Row size: 21 Total Rows: 6772595 Initial runs: 2 Merge passes: 1 IO Cost / pass: 5660 Total IO sort cost: 23073 Total CPU sort cost: 7353586202 Total Temp space used: 217588000
GENERAL PLANS
thanks again.
--peter
Received on Thu Nov 17 2005 - 12:56:32 CST