pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Tweak catalog indexing abstraction for upcoming WARM
Date: Tue, 31 Jan 2017 21:47:00 +0000
Message-ID: <E1cYgGS-00043C-BA@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Tweak catalog indexing abstraction for upcoming WARM

Split the existing CatalogUpdateIndexes into two different routines,
CatalogTupleInsert and CatalogTupleUpdate, which do both the heap
insert/update plus the index update.  This removes over 300 lines of
boilerplate code all over src/backend/catalog/ and src/backend/commands.
The resulting code is much more pleasing to the eye.

Also, by encapsulating what happens in detail during an UPDATE, this
facilitates the upcoming WARM patch, which is going to add a few more
lines to the update case making the boilerplate even more boring.

The original CatalogUpdateIndexes is removed; there was only one use
left, and since it's just three lines, we can as well expand it in place
there.  We could keep it, but WARM is going to break all the UPDATE
out-of-core callsites anyway, so there seems to be no benefit in doing
so.

Author: Pavan Deolasee
Discussion: https://www.postgr.es/m/CABOikdOcFYSZ4vA2gYfs=M2cdXzXX4qGHeEiW3fu9PCfkHLa2A@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2f5c9d9c9cec436e55847ec580606d7e88067df6

Modified Files
--------------
src/backend/catalog/aclchk.c               |  72 +++----------
src/backend/catalog/heap.c                 |  46 +++------
src/backend/catalog/index.c                |  14 +--
src/backend/catalog/indexing.c             |  44 ++++++--
src/backend/catalog/pg_aggregate.c         |   4 +-
src/backend/catalog/pg_collation.c         |   5 +-
src/backend/catalog/pg_constraint.c        |  17 +---
src/backend/catalog/pg_conversion.c        |   5 +-
src/backend/catalog/pg_db_role_setting.c   |  15 +--
src/backend/catalog/pg_depend.c            |   3 +-
src/backend/catalog/pg_enum.c              |  13 +--
src/backend/catalog/pg_largeobject.c       |   4 +-
src/backend/catalog/pg_namespace.c         |   4 +-
src/backend/catalog/pg_operator.c          |  17 +---
src/backend/catalog/pg_proc.c              |   6 +-
src/backend/catalog/pg_publication.c       |   3 +-
src/backend/catalog/pg_range.c             |   3 +-
src/backend/catalog/pg_shdepend.c          |  20 +---
src/backend/catalog/pg_type.c              |  16 +--
src/backend/catalog/toasting.c             |   5 +-
src/backend/commands/alter.c               |   9 +-
src/backend/commands/amcmds.c              |   3 +-
src/backend/commands/analyze.c             |   7 +-
src/backend/commands/cluster.c             |   9 +-
src/backend/commands/comment.c             |  16 +--
src/backend/commands/dbcommands.c          |  21 +---
src/backend/commands/event_trigger.c       |   9 +-
src/backend/commands/extension.c           |  15 +--
src/backend/commands/foreigncmds.c         |  29 ++----
src/backend/commands/functioncmds.c        |  21 ++--
src/backend/commands/matview.c             |   4 +-
src/backend/commands/opclasscmds.c         |  16 +--
src/backend/commands/operatorcmds.c        |   3 +-
src/backend/commands/policy.c              |  20 +---
src/backend/commands/proclang.c            |   7 +-
src/backend/commands/publicationcmds.c     |   9 +-
src/backend/commands/schemacmds.c          |   6 +-
src/backend/commands/seclabel.c            |  15 +--
src/backend/commands/sequence.c            |   6 +-
src/backend/commands/subscriptioncmds.c    |   9 +-
src/backend/commands/tablecmds.c           | 156 ++++++++---------------------
src/backend/commands/tablespace.c          |  10 +-
src/backend/commands/trigger.c             |  18 +---
src/backend/commands/tsearchcmds.c         |  31 ++----
src/backend/commands/typecmds.c            |  18 +---
src/backend/commands/user.c                |  21 ++--
src/backend/replication/logical/origin.c   |   3 +-
src/backend/rewrite/rewriteDefine.c        |  19 +---
src/backend/rewrite/rewriteSupport.c       |   5 +-
src/backend/storage/large_object/inv_api.c |  12 +--
src/backend/utils/cache/relcache.c         |   3 +-
src/include/catalog/indexing.h             |   4 +-
52 files changed, 256 insertions(+), 594 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: <E1cYgGS-00043C-BA@gemulon.postgresql.org>
Permalink:  ../E1cYgGS-00043C-BA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cYgGS-00043C-BA@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Tweak catalog indexing abstraction for upcoming WARM
  In-Reply-To: <E1cYgGS-00043C-BA@gemulon.postgresql.org>
  References: <E1cYgGS-00043C-BA@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