Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Index compression vs. table compression
Thomas Kyte wrote:
> In article <41d57a50$0$5112$afc38c87_at_news.optusnet.com.au>, Howard J. Rogers
> says...
>
>>Jonathan Lewis wrote: >> >>>Notes inline >>> >>>"Howard J. Rogers" <hjr_at_dizwell.com> wrote in message >>>news:41d49207$0$3805$afc38c87_at_news.optusnet.com.au... >>> >>> >>> Not if they're being used for doing lookups, I hope. >> >>Why? >> >>A small table is always likely to be read via a FTS using CBO. Even for >>a single key lookup... >> >>
I didn't say you couldn't cite me examples of single key table access via the index still being cheaper than via a FTS for a small table. I said it was "likely" that small tables would be read via FTS for a lookup, not that it would invariably be so. The threshold you refer to is significant in this discussion regarding what constitutes "small" and, I would suggest, what constitutes "likely".
SQL> create table e as select * from emp; Table created.
SQL> insert into e select * from e;
14 rows created.
SQL> /
28 rows created.
SQL> /
56 rows created.
SQL> /
112 rows created.
SQL> /
224 rows created.
SQL> commit;
Commit complete.
SQL> create index e_empno_idx on e(empno); Index created.
SQL> analyze table e compute statistics; Table analyzed.
SQL> set autotrace traceonly explain
SQL> select * from e where empno=7934;
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=32 Bytes=1024 )
1 0 TABLE ACCESS (FULL) OF 'E' (Cost=2 Card=32 Bytes=1024)
I would call 448 rows "small". And "where empno=7934" was a single key lookup.
Regards
HJR
Received on Sat Jan 22 2005 - 01:59:34 CST