pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Replace binary search in fmgr_isbuiltin with a lookup array.
Date: Wed, 04 Oct 2017 07:28:38 +0000
Message-ID: <E1dze6g-0001Ni-KK@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Replace binary search in fmgr_isbuiltin with a lookup array.

Turns out we have enough functions that the binary search is quite
noticeable in profiles.

Thus have Gen_fmgrtab.pl build a new mapping from a builtin function's
oid to an index in the existing fmgr_builtins array. That keeps the
additional memory usage at a reasonable amount.

Author: Andres Freund, with input from Tom Lane
Discussion: https://postgr.es/m/20170914065128.a5sk7z4xde5uy3ei@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/212e6f34d55c910505f87438d878698223d9a617

Modified Files
--------------
src/backend/utils/Gen_fmgrtab.pl | 79 +++++++++++++++++++++++++++++++++-------
src/backend/utils/Makefile       |  2 +-
src/backend/utils/fmgr/fmgr.c    | 29 ++++++---------
src/include/utils/fmgrtab.h      | 11 +++++-
4 files changed, 88 insertions(+), 33 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1dze6g-0001Ni-KK@gemulon.postgresql.org>
Permalink:  ../E1dze6g-0001Ni-KK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dze6g-0001Ni-KK@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: andres@anarazel.de
  Subject: Re: pgsql: Replace binary search in fmgr_isbuiltin with a lookup array.
  In-Reply-To: <E1dze6g-0001Ni-KK@gemulon.postgresql.org>
  References: <E1dze6g-0001Ni-KK@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