Performance tuning on INNER JOIN with BETWEEN Condition

后端 未结 1 1631
南笙
南笙 2020-12-12 01:41

I have two table\'s namely tbl_Small and tbl_Large.

Both the table\'s I have stored in Microsoft Azure and querying from

相关标签:
1条回答
  • 2020-12-12 01:55

    Your index on tbl_Large needs to be covering i.e. it holds all the data the query needs. If you just create an index on the one column then to get all the data the server will need to use the index and another source to get the other column data. It's probable it won't find it worth the extra work and will ignore the index all together.

    For tbl_Large create an index on both col a and col b and also include the value for col c so the code looks like this:

    CREATE NONCLUSTERED INDEX IX_tbl_Large_cola_colb on tbl_Large (cola, colb)
    INCLUDE (colc)
    
    0 讨论(0)
提交回复
热议问题