a question or two re fulltext queries
- From: "tbh" <femdev@xxxxxxxxxxxxxxxxx>
- Date: Tue, 7 Feb 2006 15:36:57 +0100
hi,
i'm using SQL Server 2000 (SP3, I think).
i am looking at SQL for finding documents (table DOC) based on a couple of
criteria, one of which involves a fulltext index on a related table (TXT).
i discovered today that a less selective CONTAINS() clause:
CONTAINS (txt_stripped, 'daimler')
results in disastrous performance when I ask for the "top 10" documents
sorted by published date (a field of DOC) descending.
if I
1) include a more selective contains clause:
CONTAINS (txt_stripped, 'daimler AND mercedes')
2) omit the "top 10" (there are only125 documents total.) or
3) omit the "ORDER BY doc_pubfrom DESC" clause
the query performs fine.
i examined the query plans and discovered that in the bad case the first
thing done is to walk the doc_pubfrom index (figures, I guess: top 10 order
by...). in the other cases the first thing done is the "remote scan" of the
fulltext index, which is what I want done first.
i already know how I'll solve this problem: i don't need the "top 10" at
this point -- it was just a whim while prototyping.
my questions, though for future reference:
1) is there syntax to influence SQL's query planning specifically to prefer
the full text index ?
2) is there a way to get the query plan textually? (the graphic view is
great but I wondered what I would do if I wanted to mail it or post it)
cheers,
Tim Hanson
.
- Follow-Ups:
- Re: a question or two re fulltext queries
- From: Hilary Cotter
- Re: a question or two re fulltext queries
- Prev by Date: Re: Ignored words error strangeness
- Next by Date: Re: Ignored words error strangeness
- Previous by thread: Re: Ignored words error strangeness
- Next by thread: Re: a question or two re fulltext queries
- Index(es):
Relevant Pages
|