[COMMITTERS] pgsql: Be more aggressive in avoiding tuple conversion. - Mailing list pgsql-committers

From Robert Haas
Subject [COMMITTERS] pgsql: Be more aggressive in avoiding tuple conversion.
Date
Msg-id E1cWDrT-0005GA-RH@gemulon.postgresql.org
Whole thread Raw
List pgsql-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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Use non-conflicting table names in new regression test case.
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Improve speed of contrib/postgres_fdw regression tests.