Re: a question or two re fulltext queries

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



1) Could you post the entire schema with indexes?

2) use set showplan_text on
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

"tbh" <femdev@xxxxxxxxxxxxxxxxx> wrote in message
news:uTlE0P$KGHA.1180@xxxxxxxxxxxxxxxxxxxxxxx
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

  • a question or two re fulltext queries
    ... i'm using SQL Server 2000 ... i am looking at SQL for finding documents based on a couple of ... one of which involves a fulltext index on a related table. ... i examined the query plans and discovered that in the bad case the first ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Not In and Not Exists
    ... you did not specify WHERE condition in the IN clause as you specify it ... > EXISTS clause and as result we got nothing. ... >> SQL Server will try to optimize query plans so neither technique ought ... >> different query plans as a result. ...
    (microsoft.public.sqlserver.programming)
  • 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)