% in the beginning of like clause

前端 未结 7 1461
你的背包
你的背包 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 11:07

    A % on the beginning of a LIKE clause means that indexes are completely useless. If there is static text to anchor the pattern to in front of the %, there's at least potential utility to be obtained from indexes.

    0 讨论(0)
提交回复
热议问题