% in the beginning of like clause

前端 未结 7 1531
你的背包
你的背包 2021-01-06 10:10

I heard that its not advised to use % in the beginning of LIKE clause in SQL Server due to performance reasons.Why is this is so?

Some more details on this will help

7条回答
  •  半阙折子戏
    2021-01-06 10:53

    having it anywhere would add a performance drain because there's no index on the content of the text field.

    With it at the start, it has to do a search at worst case to the end of the text field.

提交回复
热议问题