Thanks a lot!
It will do a clustered index scan. this is what it looks like.
StmtText
SELECT * from authors
WHERE
CONTAINS( *, 'keyworkd')
OR
au_lname LIKE '%keyworkd%'
(1 row(s) affected)
StmtText
----
|--Filter(WHERE

[Expr1004]))
|--Nested Loops(Left Semi Join, WHERE

'%keyworkd%', NULL))OUTER REFERENCES


= [PROBE VALUE]))
|--Clustered Index
Scan(OBJECT

|--Filter(WHERE

|--Table Spool
|--Remote Scan(OBJECT

(6 row(s) affected)
I didn't think you were being serious before.
Basically it does a remote scan of the full text catalog (|--Remote
Scan(OBJECT

against the authors table - scanning the au_id column using the auidind
index (this is a clustered index scan)
Scan(OBJECT

|--Filter(WHERE

|--Table Spool
It then does a nested loop against the authors table using the join (Left
Semi Join, WHERE

and filters the results.
Put this query in query analyzer and hit ctrl - L
and you can see it for yourself.
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
"Matias Woloski" <woloski@.NOSPAMsion.com> wrote in message
news:OJYMB6lVFHA.1328@.tk2msftngp13.phx.gbl...
> Hillary, would you mind doing a small explanation on this post?
> Thanks a lot!
> It will do a clustered index scan. this is what it looks like.
>
> StmtText
> ----
--
> --
> SELECT * from authors
> WHERE
> CONTAINS( *, 'keyworkd')
> OR
> au_lname LIKE '%keyworkd%'
> (1 row(s) affected)
> StmtText
> ----
--
> ----
--
> --
> |--Filter(WHERE

> [Expr1004]))
> |--Nested Loops(Left Semi Join, WHERE

> '%keyworkd%', NULL))OUTER REFERENCES

DEFINE

> = [PROBE VALUE]))
> |--Clustered Index
> Scan(OBJECT

> |--Filter(WHERE

> |--Table Spool
> |--Remote Scan(OBJECT

> (6 row(s) affected)
>
>
|||Thanks Hilary for introducing me into this.
Now, I see the execution plan for this query and I see that 87% of the query
is the remote scan (contains).
I was concerned about the perf impact of having CONTAINS and LIKE both
together and it seems that is minimal.
What if I have 100k records? How the clustered index (like expr) would
perform? How compared to a query which only does a remote scan?
Thanks again for your help,
Matias
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uHajidvVFHA.2768@.tk2msftngp13.phx.gbl...
>I didn't think you were being serious before.
> Basically it does a remote scan of the full text catalog (|--Remote
> Scan(OBJECT

> against the authors table - scanning the au_id column using the auidind
> index (this is a clustered index scan)
> Scan(OBJECT

> |--Filter(WHERE

> |--Table Spool
> It then does a nested loop against the authors table using the join (Left
> Semi Join, WHERE

> and filters the results.
> Put this query in query analyzer and hit ctrl - L
> and you can see it for yourself.
>
> --
> 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
> "Matias Woloski" <woloski@.NOSPAMsion.com> wrote in message
> news:OJYMB6lVFHA.1328@.tk2msftngp13.phx.gbl...
> --
> --
> --
> DEFINE

>
>
|||The nested loop is changed to a merge join
|--Filter(WHERE

[Expr1004]))
|--Merge Join(Left Semi Join,
MERGE

RESIDUAL

like([fulltext].[charcol], '%keyworkd%', NULL))
|--Clustered Index
Scan(OBJECT

|--Sort(ORDER BY

|--Remote Scan(OBJECT

(5 row(s) affected)
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
"Matias Woloski" <woloski@.NOSPAMsion.com> wrote in message
news:uZPS3KxVFHA.2496@.TK2MSFTNGP10.phx.gbl...
> Thanks Hilary for introducing me into this.
> Now, I see the execution plan for this query and I see that 87% of the
query[vbcol=seagreen]
> is the remote scan (contains).
> I was concerned about the perf impact of having CONTAINS and LIKE both
> together and it seems that is minimal.
> What if I have 100k records? How the clustered index (like expr) would
> perform? How compared to a query which only does a remote scan?
> Thanks again for your help,
> Matias
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uHajidvVFHA.2768@.tk2msftngp13.phx.gbl...
join[vbcol=seagreen]
(Left[vbcol=seagreen]
-[vbcol=seagreen]
-[vbcol=seagreen]
-[vbcol=seagreen]
WHERE

|--Filter(WHERE

>
No comments:
Post a Comment