full text search - FreeTextTable bad performance with SQL Server 2008 -
my index populated 12 millions of rows datassearch_fr table
fields :
[id] [int] identity(1,1) not null, [data] [nvarchar](max) not null, [dataid] [varchar](200) not null, [datatypeid] [int] not null
by using freetexttable this:
select * freetexttable(datassearch_fr, (data), 'din', language 1036) ft
query returns 12 000 rows instantly
but using freetexttable this:
select dataid, datatypeid, max(rank) rank datassearch_fr inner join freetexttable(datassearch_fr, (data), 'din', language 1036) ft on ft.[key] = id group dataid, datatypeid
query returns 4400 rows in 10 or 15 seconds...
problem me not 4400 rows returned, point logically dûe max(rank)
, group by
...but 10 or 15 seconds seem , slowest response time not case keywords searched.
do know way improve response time ?
thanks help, sébastien
by using
set statistics io on
i have result:
table 'datassearch_fr'. scan count 5, logical reads 37861, physical reads 0, read-ahead 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
table 'worktable'. scan count 0, logical reads 0, physical reads 0, read-ahead 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
if have idea. :)
edit: below, query execution plan
|--parallelism(gather streams) |--hash match(aggregate, hash:([database].[dbo].[datassearch_fr].[dataid], [database].[dbo].[datassearch_fr].[datatypeid]), residual:([database].[dbo].[datassearch_fr].[dataid] = [database].[dbo].[datassearch_fr].[dataid] , [database].[dbo].[datassearch_fr].[datatypeid] = [database].[dbo].[datassearch_fr].[datatypeid]) define:([expr1007]=max(convert(int,[expr1005],0)))) |--parallelism(repartition streams, hash partitioning, partition columns:([database].[dbo].[datassearch_fr].[dataid], [database].[dbo].[datassearch_fr].[datatypeid])) |--hash match(inner join, hash:(fulltextmatch.[docid])=([database].[dbo].[datassearch_fr].[id])) |--bitmap(hash:(fulltextmatch.[docid]), define:([bitmap1012])) | |--stream aggregate(group by:(fulltextmatch.[docid]) define:([expr1005]=max([expr1004]))) | |--parallelism(repartition streams, hash partitioning, partition columns:(fulltextmatch.[docid]), order by:(fulltextmatch.[docid] asc)) | |--stream aggregate(group by:(fulltextmatch.[docid], fulltextmatch.[colid]) define:([expr1004]=sum([expr1008]))) | |--compute scalar(define:([expr1008]=freetexttablerank((0),fulltextmatch.[termfrequency],fulltextmatch.[columnweight]*convert_implicit(float(53),fulltextmatch.[documentlength],0),fulltextmatch.[columnweight]*convert_implicit(float(53),fulltextmatch.[avdl],0),fulltextmatch.[termweight]))) | |--parallelism(distribute streams, hash partitioning, partition columns:(fulltextmatch.[docid], fulltextmatch.[colid])) | |--table-valued function |--parallelism(repartition streams, hash partitioning, partition columns:([database].[dbo].[datassearch_fr].[id])) |--index scan(object:([database].[dbo].[datassearch_fr].[ix_datassearch_fr_idnew]), where:(probe([bitmap1012],[database].[dbo].[datassearch_fr].[id],n'[in row]')))
Comments
Post a Comment