postgresql/src/backend/utils/cache
Tom Lane 8d65da1f01 Support ordered-set (WITHIN GROUP) aggregates.
This patch introduces generic support for ordered-set and hypothetical-set
aggregate functions, as well as implementations of the instances defined in
SQL:2008 (percentile_cont(), percentile_disc(), rank(), dense_rank(),
percent_rank(), cume_dist()).  We also added mode() though it is not in the
spec, as well as versions of percentile_cont() and percentile_disc() that
can compute multiple percentile values in one pass over the data.

Unlike the original submission, this patch puts full control of the sorting
process in the hands of the aggregate's support functions.  To allow the
support functions to find out how they're supposed to sort, a new API
function AggGetAggref() is added to nodeAgg.c.  This allows retrieval of
the aggregate call's Aggref node, which may have other uses beyond the
immediate need.  There is also support for ordered-set aggregates to
install cleanup callback functions, so that they can be sure that
infrastructure such as tuplesort objects gets cleaned up.

In passing, make some fixes in the recently-added support for variadic
aggregates, and make some editorial adjustments in the recent FILTER
additions for aggregates.  Also, simplify use of IsBinaryCoercible() by
allowing it to succeed whenever the target type is ANY or ANYELEMENT.
It was inconsistent that it dealt with other polymorphic target types
but not these.

Atri Sharma and Andrew Gierth; reviewed by Pavel Stehule and Vik Fearing,
and rather heavily editorialized upon by Tom Lane
2013-12-23 16:11:35 -05:00
..
attoptcache.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
catcache.c Silence benign warnings from clang version 3.0-6ubuntu3. 2013-11-07 16:35:43 -06:00
evtcache.c Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. 2013-07-02 09:47:01 -04:00
inval.c Refine our definition of what constitutes a system relation. 2013-11-28 20:57:20 -05:00
lsyscache.c Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
Makefile Add infrastructure for mapping relfilenodes to relation OIDs. 2013-07-22 11:09:10 -04:00
plancache.c Account better for planning cost when choosing whether to use custom plans. 2013-08-24 15:14:17 -04:00
relcache.c Fix more instances of "the the" in comments. 2013-12-13 20:02:01 +02:00
relfilenodemap.c Mark variables 'static' where possible. Move GinFuzzySearchLimit to ginget.c 2013-12-16 11:41:17 +02:00
relmapper.c Add infrastructure for mapping relfilenodes to relation OIDs. 2013-07-22 11:09:10 -04:00
spccache.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
syscache.c Make catalog cache hash tables resizeable. 2013-09-05 20:20:03 +03:00
ts_cache.c Update comments concerning PGC_S_TEST. 2013-09-03 18:56:22 -04:00
typcache.c Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. 2013-07-02 09:47:01 -04:00