Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long running query
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Long running query
Miscellaneous
Thread ID:
00891920
Message ID:
00891920
Views:
48
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
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform