pgsql: Provide moving-aggregate support for a bunch of numerical aggreg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Provide moving-aggregate support for a bunch of numerical aggreg
Date: 2014-04-13 00:33:31
Message-ID: E1WZ8MV-0002Pg-8x@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Provide moving-aggregate support for a bunch of numerical aggregates.

First installment of the promised moving-aggregate support in built-in
aggregates: count(), sum(), avg(), stddev() and variance() for
assorted datatypes, though not for float4/float8.

In passing, remove a 2001-vintage kluge in interval_accum(): interval
array elements have been properly aligned since around 2003, but
nobody remembered to take out this workaround. Also, fix a thinko
in the opr_sanity tests for moving-aggregate catalog entries.

David Rowley and Florian Pflug, reviewed by Dean Rasheed

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9d229f399e87d2ae7132c2e8feef317ce1479728

Modified Files
--------------
src/backend/utils/adt/int8.c | 63 +++-
src/backend/utils/adt/numeric.c | 379 +++++++++++++++++++++---
src/backend/utils/adt/timestamp.c | 72 +++--
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_aggregate.h | 266 ++++++++---------
src/include/catalog/pg_proc.h | 20 ++
src/include/utils/builtins.h | 7 +
src/include/utils/int8.h | 2 +
src/include/utils/timestamp.h | 1 +
src/test/regress/expected/opr_sanity.out | 12 +-
src/test/regress/expected/window.out | 475 ++++++++++++++++++++++++++++++
src/test/regress/sql/opr_sanity.sql | 12 +-
src/test/regress/sql/window.sql | 141 +++++++++
13 files changed, 1230 insertions(+), 222 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-04-13 01:20:24 pgsql: Make security barrier views automatically updatable
Previous Message Tom Lane 2014-04-12 16:08:24 pgsql: Create infrastructure for moving-aggregate optimization.