Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Q: partition table question ?
Sir,
I created a test table with following 4 partitions, insert 10 records to
partition q1 and analyze the table with compute stat. Why autotrace did
not show only partition q1 is scanned ? Is is necessay to define index
before partition elimination taking place ?
Thanks in advance, Ted Chyn(tedchyn_at_yahoo.com)
CREATE TABLE sale
( invoice_no NUMBER,
sale_year INT NOT NULL, sale_month INT NOT NULL, sale_day INT NOT NULL )
PARTITION q2 VALUES LESS THAN (1999, 03, 01), PARTITION q3 VALUES LESS THAN (1999, 04, 01), PARTITION q4 VALUES LESS THAN (1999, 05, 01)) ;
SQL> analyze table sale compute statistics;
Table analyzed.
SQL> set autotrace on
SQL> l
1* select count(*) from sale partition(q1)
SQL> /
COUNT(*)
10
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1)
1 0 SORT (AGGREGATE)
2 1 TABLE ACCESS (FULL) OF 'SALE' (Cost=1 Card=10)
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Oct 12 1999 - 17:41:59 CDT