views:

215

answers:

2

I have the following SQL query:

SELECT TOP 200 * FROM article WITH (nolock) 
WHERE CONTAINS(*,'"ram*" and "1*"')
ORDER BY article_number

I am getting no results returned within 10 minute. If I stop the query after a few minutes then it returns a few records.

In article table there are 10,000 records. The full text catalog is on article 4-5 fields, so it contains only 1 table.

If I don't write the ORDER BY or the TOP 200 clause then it returns immediately with the correct answer.

Article table has INDEX (Unique, clustered) on Article_number.

I think it is an MS-SQL 2008 bug.

The problem also exists on SQL 2008 SP1.

I really don't understand the problem, please help.

A: 

Order by makes the query slower. Does article_number has index? Try creating an index.

Daniel Moura
+1  A: 

I don't believe you can do a search with terms less than 3 characters in length. As a test, try searching for something else, like:

select top 200 * from article with (nolock) WHERE contains(,'"ram" and "king*"') order by article_number
John Rasch
But there is two word separated with and word. So it's reasonable to search like this.