I have a free text catalog on a simple table on SQL Server 2008R2:
CREATE FULLTEXT CATALOG customer_catalog;
CREATE FULLTEXT INDEX ON customer
(
name1
)
KEY INDEX customer_pk
ON customer_catalog;
ALTER FULLTEXT INDEX ON customer START UPDATE POPULATION;
If I perform the following three queries the first two return almost immediately, while the last one takes ~14 seconds on a table with 100,000 records:
SELECT
customer_id
FROM
customer
WHERE
CONTAINS(customer.*, 'nomatch');
SELECT
customer_id
FROM
customer
WHERE
customer.customer_id = 0;
SELECT
customer_id
FROM
customer
WHERE
CONTAINS(customer.*, 'nomatch')
OR customer.customer_id = 0;
Here are the queryplans:
Why is the third query so much slower? Can I do anything to improve it or do I need to split the query?