How CONTAINSTABLE works with many search words

Viewed 1093

For example I got a table Companies. There is a field FullName in it, on which I got full-text index. Then I join that table with CONTAINSTABLE with @search_word like "company*" AND "name*" AND "oil*" AND "propan*" AND "liquid*"... from 1 to 10 words.

And I know that words (with variants *) got this number of matches:

  • company - 10k
  • name - 5k
  • oil - 2k
  • propan - 1k
  • liquid - 500
  • all words above in 1 row - 300 matches

So, if I will search in that order:

@search = '"company*" AND "name*" AND "oil*" AND "propan*" AND "liquid*"'

and in that order:

@search = '"liquid*" AND "propan*" AND "oil*" AND "name*" AND "company*"'

SELECT [FullName]
FROM dbo.Companies c
INNER JOIN CONTAINSTABLE (dbo.Companies, [FullName], @search) as s ON s.[KEY] = c.[KEY_FIELD];

Will I have any differences in speed of my query?

1 Answers
Related