shadowfox Posted June 30, 2009 Share Posted June 30, 2009 Is there any downsides to using sum()? I have to pull the the same data of the sum of 20 other fields and didn't know if it would be best just to leave it using the sum() function or to make php do some work and to create a field that will be updated with the result of the sum of the other fields? Quote Link to comment https://forums.phpfreaks.com/topic/164186-sum-performance-question/ Share on other sites More sharing options...
gizmola Posted June 30, 2009 Share Posted June 30, 2009 The mysql sum will be more efficient, than querying a table, fetching the rows and adding them up in php. However, don't understand your "20 other fields" comment sufficiently. Quote Link to comment https://forums.phpfreaks.com/topic/164186-sum-performance-question/#findComment-866109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.