aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/json.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-11-16 18:46:34 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-11-16 18:46:34 -0500
commit69c8fbac201652282e18b0e2e301d4ada991fbde (patch)
tree65de0a6818fd9ccb809ddeaf095a5bed285239b0 /src/backend/utils/adt/json.c
parent6cb86143e8e1e855255edc706bce71c6ebfd9a6c (diff)
downloadpostgresql-69c8fbac201652282e18b0e2e301d4ada991fbde.tar.gz
postgresql-69c8fbac201652282e18b0e2e301d4ada991fbde.zip
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
Diffstat (limited to 'src/backend/utils/adt/json.c')
0 files changed, 0 insertions, 0 deletions