Why are the performances of these 2 queries so different?
问题 I have a stored proc that searches for products (250,000 rows) using a full text index. The stored proc takes a parameter that is the full text search condition. This parameter can be null, so I added a null check and the query suddenly started running orders of magnitude slower. -- This is normally a parameter of my stored proc DECLARE @Filter VARCHAR(100) SET @Filter = 'FORMSOF(INFLECTIONAL, robe)' -- #1 - Runs < 1 sec SELECT TOP 100 ID FROM dbo.Products WHERE CONTAINS(Name, @Filter) -- #2