SQL Server - Comparing to NULL very slow

后端 未结 4 1450
感情败类
感情败类 2021-01-22 11:52

I want to speed up the following query

There are two conditions in the WHERE clause (see below query for reference)

Currently, it takes about 60 seconds. However

4条回答
  •  失恋的感觉
    2021-01-22 12:18

    Here's one option that might speed it up using coalesce:

    ...
    where contains(b.BookTitle, coalesce(@Query,b.BookTitle))
    ...
    

提交回复
热议问题