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

From Tom Lane
Subject pgsql: Provide moving-aggregate support for a bunch of numerical aggreg
Date
Msg-id E1WZ8MV-0002Pg-8x@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Create infrastructure for moving-aggregate optimization.
Next
From: Stephen Frost
Date:
Subject: pgsql: Make security barrier views automatically updatable