Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Index on non unique values to avoid full table scan

794267Nov 7 2011 — edited Nov 11 2011
I have a table with > 100k records. The table is refreshed only during nightly run. All the columns apart from one have non - unique values and I am querying the table with this query -

col3 - non - unique values - only 40 distinct values
col4 - non - unique values - 1000 distinct values
last_column - 100k Unique values

Select last_column from table_name where col3 in (...) or col4 in (...)

I have tried creating a Bitmap index individually on col3 and col4 and also combined. However in both the cases it performs a full table scan.

Please help me to optimize this query as this is being used in the system quite freuently and the cost of the query is very high around 650.

I don't have much experience with indices so any leads appreciated.

Thanks,
Neetesh

Edited by: user13312817 on 7 Nov, 2011 11:32 AM
This post has been answered by AdamMartin on Nov 8 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2011
Added on Nov 7 2011
29 comments
918 views