Trying to prove something now to see if an index needs to be added.
If I have an index in columns A, B, C, and I, create a query that explicitly uses A and C in the where clause, will I get an index advantage?
In this scenario, imagine the where clause as follows:
A = 'Q' AND (B is not null OR B is null) AND C='G'
I researched this in Oracle using EXPLAIN PLAN and it doesn't seem to use an index. Also, from my understanding of how indexes are created and used, it will not be able to take advantage, since the index cannot use column B due to lack of specificity.
We are currently considering this in both MSSQL and ORACLE. Not sure if someone is optimizing differently than the other.
Any advice is appreciated! Thank!
source
share