Re: Optimizer Question [message #18340] |
Mon, 28 January 2002 09:38 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
Do a warm query. i.e. don't measure the time for the first execution of the query. Run them both twice.
Also - check the gathered stats on the tables. If Oracle thinks there are only a few rows in the table it may decide not to use the index, whereas you may have tons of records.
select table_name, num_rows, last_analyzed from user_tables where table_name = ...;
select table_name, index_name, num_rows, last_analyzed from user_indexes where table_name = ...;
compare that to select count(*) from ...;
Analyze table ... estimate statistics;
|
|
|