Is an index on A, B redundant if there is an index on A, B, C?

后端 未结 5 2046
庸人自扰
庸人自扰 2021-02-02 18:30

Having years of experience as a DBA, I do believe I know the answer to the question, but I figured it never hurts to check my bases.

Using SQL Server, assuming I have a

5条回答
  •  粉色の甜心
    2021-02-02 18:56

    I typically would find this "almost" similar index in table that contains historical data. If column C is a date or integer column, be careful. It is most likely used to satisfy the MAX function as in WHERE tblA.C = MAX(tblB.C), which skips the table altogether and utilize an index only access path.

提交回复
热议问题