I have a query like this (created by LINQ):
SELECT [t0].[Id], [t0].[CreationDate], [t0].[CreatorId]
FROM [dbo].[DataFTS]('test', 100) AS [t0]
WHERE [t0].[CreatorId] = 1
ORDER BY [t0].[RANK]
DataFTS is a full-text search table valued function. The query execution plan looks like this:
SELECT (0%) - Sort (23%) - Nested Loops (Inner Join) (1%) - Sort (Top N Sort) (25%) - Stream Aggregate (0%) - Stream Aggregate (0%) - Compute Scalar (0%) - Table Valued Function (FullTextMatch) (13%)
|
|
- Clustered Index Seek (38%)
Does this mean that the WHERE clause ([CreatorId] = 1) is executed prior to the TVF ( full text search) or after the full text search? Is the TVF looking at the narrowed data set (narrowed by the WHERE clause), or at the entire table?
The TVF looks like this:
FUNCTION [dbo].[DataFTS] (@searchtext nvarchar(4000), @limitcount int)
RETURNS TABLE
AS
RETURN
SELECT * FROM Databook
INNER JOIN CONTAINSTABLE(Databook, *, @searchtext, @limitcount)
AS KEY_TBL ON Databook.Id = KEY_TBL.[KEY]
Thank you.