pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Be more aggressive in avoiding tuple conversion.
Date: Wed, 25 Jan 2017 03:03:03 +0000
Message-ID: <E1cWDrT-0005GA-RH@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Be more aggressive in avoiding tuple conversion.

According to the comments in tupconvert.c, it's necessary to perform
tuple conversion when either table has OIDs, and this was previously
checked by ensuring that the tdtypeid value matched between the tables
in question.  However, that's overly stringent: we have access to
tdhasoid and can test directly whether OIDs are present, which lets us
avoid conversion in cases where the type OIDs are different but the
tuple descriptors are entirely the same (and neither has OIDs).  This
is useful to the partitioning code, which can thereby avoid converting
tuples when inserting into a partition whose columns appear in the
same order as the parent columns, the normal case.  It's possible
for the tuple routing code to avoid some additional overhead in this
case as well, so do that, too.

It's not clear whether it would be OK to skip this when both tables
have OIDs: do callers count on this to build a new tuple (losing the
previous OID) in such instances?  Until we figure it out, leave the
behavior in that case alone.

Amit Langote, reviewed by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3838074f864eda344677fba39c6141ccbcd4104b

Modified Files
--------------
src/backend/access/common/tupconvert.c | 18 ++++++++++--------
src/backend/catalog/partition.c        |  3 +--
2 files changed, 11 insertions(+), 10 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: <E1cWDrT-0005GA-RH@gemulon.postgresql.org>
Permalink:  ../E1cWDrT-0005GA-RH@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cWDrT-0005GA-RH@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: rhaas@postgresql.org
  Subject: Re: pgsql: Be more aggressive in avoiding tuple conversion.
  In-Reply-To: <E1cWDrT-0005GA-RH@gemulon.postgresql.org>
  References: <E1cWDrT-0005GA-RH@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