pgsql: Avoid extra AggCheckCallContext() checks in ordered-set aggregat

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid extra AggCheckCallContext() checks in ordered-set aggregat
Date: 2014-01-08 19:34:35
Message-ID: E1W0ytf-0005ba-TI@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid extra AggCheckCallContext() checks in ordered-set aggregates.

In the transition functions, we don't really need to recheck this after the
first call. I had been feeling paranoid about possibly getting a non-null
argument value in some other context; but it's probably game over anyway
if we have a non-null "internal" value that's not what we are expecting.

In the final functions, the general convention in pre-existing final
functions seems to be that an Assert() is good enough, so do it like that
here too.

This seems to save a few tenths of a percent of overall query runtime,
which isn't much, but still it's just overhead if there's not a plausible
case where the checks would fire.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/847e46abc92333a5a948d8fa886604832c1db238

Modified Files
--------------
src/backend/utils/adt/orderedsetaggs.c | 42 +++++++-------------------------
1 file changed, 9 insertions(+), 33 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-08 21:33:07 pgsql: Fix pause_at_recovery_target + recovery_target_inclusive combina
Previous Message Tom Lane 2014-01-08 18:59:20 pgsql: Save a few cycles in advance_transition_function().