SQL Server全文搜索速度慢

时间:2016-05-18 09:30:32

标签: sql sql-server

我已经为全文搜索创建了一个目录:

CREATE TABLE [dbo].[full_text](
[client_id] [int] NOT NULL,
[file_id] [bigint] NOT NULL,
[page_number] [int] NULL,
[contents] [nvarchar](max) NULL,
[ID] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [PK_full_text] PRIMARY KEY CLUSTERED 
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,        ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

create fulltext catalog dd_full_text;
GO

create fulltext index on full_text(contents)
key index PK_full_text on dd_full_text with change_tracking auto
GO

我正在使用相同的查询进行测试:

SELECT *
FROM full_text
WHERE CONTAINS(contents, '"ban*" AND NOT "sab*"');
GO

首先查询速度很快,但在几分钟后进行相同的查询会变得更慢。在此测试期间,我没有插入新行。

请参阅此表:

响应时间ms

  1. 2266
  2. 3250
  3. 3459
  4. 11841(10分钟后)
  5. 15391
  6. 我调查了其他帖子:

    https://stackoverflow.com/questions/28093909/sql-server-full-text-search-too-slow

    SQL Server 2008 Full Text Search – SLOW

    SQL Server Full Text Search Very Slow

    但我找不到解决方案。

0 个答案:

没有答案