Group by slow at first time in sql server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vivek484957
    New Member
    • Mar 2014
    • 1

    #1

    Group by slow at first time in sql server

    Hi Sir,

    I need your help, here is my query, it is slow first time

    Code:
    SELECT  COUNT(1) AS Results FROM ImportShipmentNew2013 
    WHERE CONTAINS(ProductDescription, 'neem') --AND (@HSCode='' OR HSCode = @HSCode )
    GROUP BY ForeignCountry
    (69 row(s) affected)
    Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'ImportShipment New2013'. Scan count 0, logical reads 721107, physical reads 0, read-ahead reads 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 reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

    (1 row(s) affected)

    Please suggest to index create to improve performance
    Last edited by Rabbit; Mar 25 '14, 03:11 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    create a full text index on your ProductDescript ion field and an index on your group by.

    Comment

    Working...