Index on non unique values to avoid full table scan
794267Nov 7 2011 — edited Nov 11 2011I 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