Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / May 2006

Tip: Looking for answers? Try searching our database.

Full text index query plans

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ekkis - 25 May 2006 17:58 GMT
I posted this message some time ago on
microsoft.public.sqlserver.programming but got no replies.  Today I
found this group so maybe I'll have better luck :)

I have a table with a full-text index on a given column.  If I run the
following:

declare @s varchar(100)
select @s = 'fast'
select * from tblHannahRES where contains(RES_SER_TI, @s)
select * from tblHannahRES where contains(RES_SER_TI, 'fast')

on my SQL2000/SP4 box I get substantially different access times, which

is unlike what I would get with a normal index i.e. performing the SQL
below (where the index is on ResID) yields identical plans and access
times:

declare @i int
select @i = 1463440
select * from tblHannahRES where ResID = @i
select * from tblHannahRES where ResID = 1463440

With the full-text indices I get the plans shown below and the second
query is consistenly 6X faster than the first.

One thing I notice is that the remote scan itself costs 0.36 vs 0.06
though both generate the same number of rows.  the second thing to
notice is that the first case incurs an extra sorting step (which costs

about 0.02 points).  I'm not sure why this should be the case.  Can
anyone elucidate on the issue here?

TIA - e

select * from tblHannahRES where contains(RES_SER_TI, @s)
 |--Nested Loops(Inner Join, OUTER
REFERENCES:([FULLTEXT:tblHannahRES].[KEY]) WITH PREFETCH)
      |--Sort(ORDER BY:([FULLTEXT:tblHannahRES].[KEY] ASC))
      |    |--Remote Scan(OBJECT:(CONTAINS))
      |--Clustered Index
Seek(OBJECT:([Merlin].[dbo].[tblHannahRES].[PK_tblHannahRES]),
SEEK:([tblHannahRES].[ResID]=[FULLTEXT:tblHannahRES].[KEY]) ORDERED
FORWARD)

select * from tblHannahRES where contains(RES_SER_TI, 'fast')
 |--Nested Loops(Inner Join, OUTER
REFERENCES:([FULLTEXT:tblHannahRES].[KEY]) WITH PREFETCH)
      |--Remote Scan(OBJECT:(CONTAINS))
      |--Clustered Index
Seek(OBJECT:([Merlin].[dbo].[tblHannahRES].[PK_tblHannahRES]),
SEEK:([tblHannahRES].[ResID]=[FULLTEXT:tblHannahRES].[KEY]) ORDERED
FORWARD)
Hilary Cotter - 26 May 2006 02:14 GMT
These are the plans I get on an equivalent machine. They are identical.
Could you post your schema.

StmtText
-----------------------------------------------------
set showplan_text on

declare @s varchar(100)
select @s = 'fast'

select * from authors where contains(au_lname, @s)

(3 row(s) affected)

StmtText
--------------------------------------------------------------------------------------------------------------------------------------------
 |--Hash Match(Left Semi Join,
HASH:([authors].[au_id])=([FULLTEXT:authors].[KEY]),
RESIDUAL:([authors].[au_id]=[FULLTEXT:authors].[KEY]))
      |--Clustered Index
Scan(OBJECT:([pubs].[dbo].[authors].[UPKCL_auidind]))
      |--Remote Scan(OBJECT:(CONTAINS))

(3 row(s) affected)

StmtText
------------------------------------------------------------

select * from authors where contains(au_lname, 'fast')

(1 row(s) affected)

StmtText
--------------------------------------------------------------------------------------------------------------------------------------------
 |--Hash Match(Left Semi Join,
HASH:([authors].[au_id])=([FULLTEXT:authors].[KEY]),
RESIDUAL:([authors].[au_id]=[FULLTEXT:authors].[KEY]))
      |--Clustered Index
Scan(OBJECT:([pubs].[dbo].[authors].[UPKCL_auidind]))
      |--Remote Scan(OBJECT:(CONTAINS))

(3 row(s) affected)

Signature

Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

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

>I posted this message some time ago on
> microsoft.public.sqlserver.programming but got no replies.  Today I
[quoted text clipped - 49 lines]
> SEEK:([tblHannahRES].[ResID]=[FULLTEXT:tblHannahRES].[KEY]) ORDERED
> FORWARD)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.