In MySQL, the leftmost prefix is applicable in the case of multi-column Index, mentioned in
Say an Index is made of (col1, col2, col3). Combinations Eligible for Index Search:
Combinations Not Eligible for Index Search:
Does SQL Server uses the same rule for Index Seek mechanisms too? Is there an official document that I can refer to? I have tried searching it around but no luck :( Thanks in advance everyone!
That rule is basically the rule for scanning b-tree indexes.
That said, there is an alternative scan method, which Oracle calls "skip scan". This allows scanning an index on keys that are not the left-most in the index. Some databases implement this, to a greater to lesser extent. Here is a good introduction to the topic. I don't believe that SQL Server implements skip-scans.
Although skip-scans are powerful, their utility depends on the cardinality of the first key in the index. If the first key has high cardinality, then they are not very effective.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With