% in the beginning of like clause

前端 未结 7 1523
你的背包
你的背包 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:55

    If you have % at the beginning of your clause, the query engine cannot generate a query plan that uses indexes but has to make table scans.

提交回复
热议问题