pgsql: Cache catalog lookup data across groups in ordered-set aggregate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Cache catalog lookup data across groups in ordered-set aggregate
Date: 2014-01-05 17:29:01
Message-ID: E1VzrVW-0004h2-03@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Cache catalog lookup data across groups in ordered-set aggregates.

The initial commit of ordered-set aggregates just did all the setup work
afresh each time the aggregate function is started up. But in a GROUP BY
query, the catalog lookups need not be repeated for each group, since the
column datatypes and sort information won't change. When there are many
small groups, this makes for a useful, though not huge, performance
improvement. Per suggestion from Andrew Gierth.

Profiling of these cases suggests that it might be profitable to avoid
duplicate lookups within tuplesort startup as well; but changing the
tuplesort APIs would have much broader impact, so I left that for
another day.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8b49a6044d06b557047210dba2735081bb037e96

Modified Files
--------------
src/backend/utils/adt/orderedsetaggs.c | 507 ++++++++++++++++++--------------
src/include/catalog/pg_operator.h | 1 +
2 files changed, 290 insertions(+), 218 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-06 10:34:11 pgsql: Remove bogus -K option from pg_dump.
Previous Message Tom Lane 2014-01-04 21:05:43 pgsql: Fix translatability markings in psql, and add defenses against f