Jump to content

Which is faster -- MYSQL SUM() or make PHP array and use array_sum()


mrherman

Recommended Posts

Hello, everyone:

 

I'm using PHP and Mysql. 

 

I've got a table of that has 30 fields that I need to add together.  I've got to do this for each record, and there are about 10,000 records.

 

Which would be more efficient? 

 

SELECT SUM( field1 + field2...)

or

to make an array for the fields and then use array_sum()

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.