Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUM in SELECT Syntax.. any way to optimize

Status
Not open for further replies.

altendew

Programmer
Mar 29, 2005
154
US
Hi I currently have this query..

Code:
SELECT sum( burst ) AS sum, sum( worth ) AS sum2
FROM 3279655_spends
WHERE donation = '0'

It will run for 14-15 seconds at a time.

I am running MySQL 4.1

Is there any way to make this query not go so slow.
 
I have it indexed as donation,id.. does having the id also ammended to it.. make it slower?
 
I had the index set to JUST donation before.. and it never relly add a problem. Then I added the row id.. and the problem started.

I dont understand why adding 1 column to an index would make it slower?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top