Content-Length: 248097 | pFad | https://github.com/postgrespro/postgres_cluster/commit/9cca11c915e458323d0e746c68203f2c11da0302

C5 Speed up SUM calculation in numeric aggregates. · postgrespro/postgres_cluster@9cca11c · GitHub
Skip to content

Commit 9cca11c

Browse files
committed
Speed up SUM calculation in numeric aggregates.
This introduces a numeric sum accumulator, which performs better than repeatedly calling add_var(). The performance comes from using wider digits and delaying carry propagation, tallying positive and negative values separately, and avoiding a round of palloc/pfree on every value. This speeds up SUM(), as well as other standard aggregates like AVG() and STDDEV() that also calculate a sum internally. Reviewed-by: Andrey Borodin Discussion: <c0545351-a467-5b76-6d46-4840d1ea8aa4@iki.fi>
1 parent 9f85784 commit 9cca11c

File tree

3 files changed

+522
-103
lines changed

3 files changed

+522
-103
lines changed

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres_cluster/commit/9cca11c915e458323d0e746c68203f2c11da0302

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy