a question or two re fulltext queries

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: a question or two re fulltext queries
    ... Looking for a SQL Server replication book? ... one of which involves a fulltext index on a related table. ... i discovered today that a less selective CONTAINSclause: ... i examined the query plans and discovered that in the bad case the first ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Writing updates from a wide DataTable
    ... SQL Server will also cache query plans for parameterized queries. ... too many i.e. not effectively caching very well. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: view object
    ... It is dangerous and a sure fire way to ... It is the query plans that make the view or ... slowing if not stopping SQL. ... Save HOURS documenting your SQL Server! ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL 2005 -> 2008 upgrade and full-text issue / The in-memory wordl
    ... I am not using SQL Server 2008 yet, so you are ahead of me there. ... Is your VARCHAR, NVARCHAR, VARBINARY, et cetera? ... I thought I might be missing the creation of a stoplist and association of ... that with the fulltext index. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: unexpected behavior with certain words "i"
    ... Looking for a SQL Server replication book? ... One of the ways to repopulate I have tried is this ... ALTER FULLTEXT INDEX ON CA_CATALOG_New_SEARCH STOP POPULATION ... ALTER FULLTEXT INDEX ON CA_CATALOG_New_SEARCH START FULL POPULATION ...
    (microsoft.public.sqlserver.fulltext)