Issue with this query
I have the following table with 2+ million rows. Message_id is primary key. We have skewed data on status column (95% of values with value 5 and 5% with value 0).
This is third-party vendor application, they run the following query looking for status of value 1 (million times a day for no reason). I have bit-map index created on status column with histogram data as well.
The issue is if I hard-code query with value 1 or 0, the query uses the bit-map index. When I use bind variable no matter what value I use, oracle does full table-scan. This is causing application slowness. I want your help on how to resolve this.