postgresql/src
Tom Lane 69c8fbac20 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
2013-11-16 18:46:34 -05:00
..
backend Improve performance of numeric sum(), avg(), stddev(), variance(), etc. 2013-11-16 18:46:34 -05:00
bin Allow aggregates to provide estimates of their transition state data size. 2013-11-16 16:03:40 -05:00
common Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
include Improve performance of numeric sum(), avg(), stddev(), variance(), etc. 2013-11-16 18:46:34 -05:00
interfaces Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
makefiles Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
pl Prevent leakage of cached plans and execution trees in plpgsql DO blocks. 2013-11-15 13:52:03 -05:00
port Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
template Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
test Improve performance of numeric sum(), avg(), stddev(), variance(), etc. 2013-11-16 18:46:34 -05:00
timezone Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
tools Fix whitespace 2013-11-13 21:25:52 -05:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:32 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Switch dependency order of libpgcommon and libpgport 2013-10-17 22:02:35 -04:00
Makefile.shlib Remove IRIX port. 2013-10-18 08:14:21 -04:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00