pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor reloption handling for index AMs in-core
Date: Mon, 25 Nov 2019 00:42:12 +0000
Message-ID: <E1iZ2SC-00012m-8g@gemulon.postgresql.org> (raw)

Refactor reloption handling for index AMs in-core

This reworks the reloption parsing and build of a couple of index AMs by
creating new structures for each index AM's options.  This split was
already done for BRIN, GIN and GiST (which actually has a fillfactor
parameter), but not for hash, B-tree and SPGiST which relied on
StdRdOptions due to an overlap with the default option set.

This saves a couple of bytes for rd_options in each relcache entry with
indexes making use of relation options, and brings more consistency
between all index AMs.  While on it, add a couple of AssertMacro() calls
to make sure that utility macros to grab values of reloptions are used
with the expected index AM.

Author: Nikolay Shaplov
Reviewed-by: Amit Langote, Michael Paquier, Álvaro Herrera, Dent John
Discussion: https://postgr.es/m/4127670.gFlpRb6XCm@x200m

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4cb658af70027c3544fb843d77b2e84028762747

Modified Files
--------------
src/backend/access/common/reloptions.c  |  4 +---
src/backend/access/hash/hashpage.c      |  2 +-
src/backend/access/hash/hashutil.c      |  9 ++++++++-
src/backend/access/nbtree/nbtree.c      |  4 ++--
src/backend/access/nbtree/nbtsort.c     |  4 ++--
src/backend/access/nbtree/nbtsplitloc.c |  2 +-
src/backend/access/nbtree/nbtutils.c    | 13 ++++++++++++-
src/backend/access/spgist/spgutils.c    | 13 ++++++++++---
src/include/access/brin.h               |  8 ++++++--
src/include/access/gin_private.h        |  9 +++++++--
src/include/access/hash.h               | 16 ++++++++++++++++
src/include/access/nbtree.h             | 18 ++++++++++++++++++
src/include/access/spgist.h             |  4 ----
src/include/access/spgist_private.h     | 22 ++++++++++++++++++++++
src/include/utils/rel.h                 |  3 +--
src/tools/pgindent/typedefs.list        |  3 +++
16 files changed, 110 insertions(+), 24 deletions(-)



Message-ID: <E1iZ2SC-00012m-8g@gemulon.postgresql.org>
Permalink:  ../E1iZ2SC-00012m-8g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iZ2SC-00012m-8g@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: michael@paquier.xyz
  Subject: Re: pgsql: Refactor reloption handling for index AMs in-core
  In-Reply-To: <E1iZ2SC-00012m-8g@gemulon.postgresql.org>
  References: <E1iZ2SC-00012m-8g@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