pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify index tuple descriptor initialization
Date: Thu, 13 Sep 2018 06:27:45 +0000
Message-ID: <E1g0L6P-0006Yo-H9@gemulon.postgresql.org> (raw)

Simplify index tuple descriptor initialization

We have two code paths for initializing the tuple descriptor for a new
index: For a normal index, we copy the tuple descriptor from the table
and reset a number of fields that are not applicable to indexes.  For an
expression index, we make a blank tuple descriptor and fill in the
needed fields based on the provided expressions.  As pg_attribute has
grown over time, the number of fields that we need to reset in the first
case is now bigger than the number of fields we actually want to copy,
so it's sensible to do it the other way around: Make a blank descriptor
and copy just the fields we need.  This also allows more code sharing
between the two branches, and it avoids having to touch this code for
almost every unrelated change to the pg_attribute structure.

Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/index.c | 57 ++++++++++++++++++---------------------------
1 file changed, 23 insertions(+), 34 deletions(-)



Message-ID: <E1g0L6P-0006Yo-H9@gemulon.postgresql.org>
Permalink:  ../E1g0L6P-0006Yo-H9@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g0L6P-0006Yo-H9@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: peter_e@gmx.net
  Subject: Re: pgsql: Simplify index tuple descriptor initialization
  In-Reply-To: <E1g0L6P-0006Yo-H9@gemulon.postgresql.org>
  References: <E1g0L6P-0006Yo-H9@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