pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless entries for aggregate functions from fmgrtab.c.
Date: Wed, 04 Nov 2020 16:26:04 +0000
Message-ID: <E1kaLbo-0004Fd-02@gemulon.postgresql.org> (raw)

Remove useless entries for aggregate functions from fmgrtab.c.

Gen_fmgrtab.pl treated aggregate functions the same as other built-in
functions, which is wasteful because there is no real need to have
entries for them in the fmgr_builtins[] table.  Suppressing those
entries saves about 3KB in the compiled table on my machine; which
is not a lot but it's not nothing either, considering that that
table is pretty "hot".  The only outside code change needed is
that ExecInitWindowAgg() can't be allowed to call fmgr_info_cxt()
on a plain aggregate function.  But that saves a few cycles anyway.

Having done that, the aggregate_dummy() function is unreferenced
and might as well be dropped.  Using "aggregate_dummy" as the prosrc
value for an aggregate is now just a documentation convention not
something that matters.  There was some discussion of using NULL
instead to save a few bytes in pg_proc, but we'd have to remove
prosrc's BKI_FORCE_NOT_NULL marking which doesn't seem a great idea.
Anyway, it's possible there's client-side code that expects to
see "aggregate_dummy" there, so I'm loath to change it without a
strong reason.

Discussion: https://postgr.es/m/533989.1604263665@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f21636e5d5b8394ed076e18ddc5f4ba710c69c99

Modified Files
--------------
src/backend/catalog/pg_aggregate.c   |  2 +-
src/backend/executor/nodeAgg.c       | 18 ------------------
src/backend/executor/nodeWindowAgg.c | 10 +++++-----
src/backend/utils/Gen_fmgrtab.pl     |  9 +++++++--
4 files changed, 13 insertions(+), 26 deletions(-)



Message-ID: <E1kaLbo-0004Fd-02@gemulon.postgresql.org>
Permalink:  ../E1kaLbo-0004Fd-02@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kaLbo-0004Fd-02@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Remove useless entries for aggregate functions from fmgrtab.c.
  In-Reply-To: <E1kaLbo-0004Fd-02@gemulon.postgresql.org>
  References: <E1kaLbo-0004Fd-02@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox