View Full Version : Aggregate functions
marek_mar
01-18-2005, 07:43 PM
Are aggregate functions fast when used with large sets of rows?
depends ...
some agregationfunctions (like count()) are optimised to return very fast. if the columns you aply an agregationfunction on, are indexed, then functions like min() and max() will also be real fast.
but you usually use agregationfunctios because they are the most efficient way to agregate the data and have MySQL do the filtering and computing, so that you only need to return a very small recordset.
Using agregationfunctions will allways be more efficient then returning large recordsets, and then do the filtering and computations in your aplicationlayer (PHP or whatever).
marek_mar
01-19-2005, 08:57 PM
Thank you raf!
you're welcome :thumbsup:
Hope you'll enjoy using them!
marek_mar
01-19-2005, 09:48 PM
NMow I figured it is the only sane way to do it. Indexing reduced the execution time of my test query from +0.03 to 0.003!
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.