Re:Postgres Performance: To avg or To sum/count
by tedchs on Thursday November 15, 2012 @11:25AM
(#4789271)
This is great research. However I completely disagree that this work supports their conclusion statement:
> In summary, partitioning SQL queries into smaller commutative ones helps you get linear performance improvements as you scale out. And in some cases, they may help you get even more. :)
The time difference between avg() and sum()/count() is merely a performance tuning opportunity in this specific case in specifically Postgres. MySQL, Oracle, etc. are going to have completely different implementations of these functions, and hypothetically could be the exact OPPOSITE performance. However this is not to degrade the insight presented in the actual body of this blog post.
> In summary, partitioning SQL queries into smaller commutative ones helps you get linear performance improvements as you scale out. And in some cases, they may help you get even more. :)
The time difference between avg() and sum()/count() is merely a performance tuning opportunity in this specific case in specifically Postgres. MySQL, Oracle, etc. are going to have completely different implementations of these functions, and hypothetically could be the exact OPPOSITE performance. However this is not to degrade the insight presented in the actual body of this blog post.