FreeText Query is slow - includes TOP and Order By

前端 未结 6 1435
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-13 15:03

The Product table has 700K records in it. The query:

SELECT TOP 1 ID, Name FROM Product WHERE contains(Name, \'\"White Dress\"\') ORDER BY DateMadeN

6条回答
  •  佛祖请我去吃肉
    2021-01-13 15:32

    I can't see the linked execution plan, network police are blocking that, so this is just a guess...

    if it is running fast without the TOP and ORDER BY, try doing this:

    SELECT TOP 1
        *
        FROM (SELECT 
                  ID, Name, DateMadeNew 
                  FROM Product 
                  WHERE contains(Name, '"White Dress"')
             ) dt
        ORDER BY DateMadeNew desc
    

提交回复
热议问题