Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long running query
Message
From
02/04/2004 19:09:07
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00891920
Message ID:
00891937
Views:
17
Do you have an indexes on dtrs and cwhouse?

Check the Execution Plan in QA for that statement to see if it is using any indexes.

>I've got a query that takes an AWFULLY long time to run:
>
>
>SELECT citemno, SUM(ntrfqty2) AS Shipped
>FROM icitrf
>WHERE (dtrs BETWEEN '02/01/04' AND '03/26/04')
>AND (cwhouse BETWEEN 'WAL0000' AND 'WAL9999')
>GROUP BY citemno
>
>
>Any hints at how I might optimize this? I have created indices on the obvious fields (dtrs, cwhouse and citemno) but it still takes forever to run.
>
>Granted, I'm running it against a table of 4 million rows but it's only returning a couple hundred result records...
>
>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform