Hello, SQL 2000
I have a query
It takes around 3 minutes to run, so I did an execution plan and found the the "Stream Aggregate/Aggregate" cost is 94%. Since the table only has 1.5 M records I did not think it should take that long.
I have indexes on accountnumber, medical and dateentered (note the PK is on a GID not setup by me).
Any suggestions on speeding this up?
Thanks for any help,
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
I have a query
Code:
SELECT AccountNumber, SUM(TransactionAmount) AS MedicalSum
FROM Mytable
WHERE Medical = 1
AND DateEntered = (SELECT MAX(DateEntered) FROM Mytable WHERE Medical = 1)
GROUP BY AccountNumber
I have indexes on accountnumber, medical and dateentered (note the PK is on a GID not setup by me).
Any suggestions on speeding this up?
Thanks for any help,
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!