I have two tables
Product (id int, brandid int,Name nvarchar(1000)) 2+ million rows
Brand (id int,name nvarchar(1000)) 20k rows
FullText index is enabled on both table's name field.
If I do a search such as
SELECT count(*)
FROM Product p join Brand b
on p.BrandID = b.ID
WHERE contains(b.name,'calvin')
Runs super fast (less than a second). Same result if ran against p.name field.
But this query
SELECT count(*)
FROM Product p join Brand b
on p.BrandID = b.ID
WHERE contains(b.name,'calvin')
OR
contains(p.Name,'calvin')
takes over a minute (several minutes actually). If OR is changed to AND it is also super fast.
I cannot use unions or containstable since I'm using nhibernate.