Fastest way for this query (What is the best strategy) given a date range

前端 未结 10 2392
半阙折子戏
半阙折子戏 2021-01-02 11:35

I have a table A that has a startDate and an end dateDate as 2 datetime columns besides some more other columns. I have another table B that has one datetime column call it

10条回答
  •  独厮守ぢ
    2021-01-02 12:18

    You need 3 indexes A.startDate, B.dates and A.endDate, may be index (A.endDate+A.startDate) is also good. I have no details on another columns and purposes for these tables, but review possibility to use clustered index.

    In anyway use "Execution plan" option to make decision between all these variants, because my suggestion is too general

提交回复
热议问题