Content-Length: 265597 | pFad | http://github.com/postgrespro/postgres/commit/69c8fbac201652282e18b0e2e301d4ada991fbde

34 Improve performance of numeric sum(), avg(), stddev(), variance(), etc. · postgrespro/postgres@69c8fba · GitHub
Skip to content

Commit 69c8fba

Browse files
committed
Improve performance of numeric sum(), avg(), stddev(), variance(), etc.
This patch improves performance of most built-in aggregates that formerly used a NUMERIC or NUMERIC array as their transition type; this includes not only aggregates on numeric inputs, but some aggregates on integer inputs where overflow of an int8 value is a possibility. The code now uses a special-purpose data structure to avoid array construction and deconstruction overhead, as well as packing and unpacking overhead for numeric values. These aggregates' transition type is now declared as INTERNAL, since it doesn't correspond to any SQL data type. To keep the planner from thinking that that means a lot of storage will be used, we make use of the just-added pg_aggregate.aggtransspace feature. The space estimate is set to 128 bytes, which is at least in the right ballpark. Hadi Moshayedi, reviewed by Pavel Stehule and Tomas Vondra
1 parent 6cb8614 commit 69c8fba

File tree

7 files changed

+362
-186
lines changed

7 files changed

+362
-186
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: http://github.com/postgrespro/postgres/commit/69c8fbac201652282e18b0e2e301d4ada991fbde

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy