minor fix for acquire_inherited_sample_rows

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: minor fix for acquire_inherited_sample_rows
Date: 2018-04-23 10:14:37
Message-ID: 0419b812-e02c-c4d9-841e-da2dc4760618@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

acquire_inherited_sample_rows() currently uses equalTupleDescs() being
false as the condition for going to tupconv.c to determine whether tuple
conversion is needed. But equalTupleDescs() will always return false if
it's passed TupleDesc's of two different tables, which is the most common
case here. So I first thought we should just unconditionally go to
tupconv.c, but there is still one case where we don't need to, which is
the case where the child table is same as the parent table. However, it
would be much cheaper to just check if the relation OIDs are different
instead of calling equalTupleDescs, which the attached patch teaches it to do.

Thanks,
Amit

Attachment Content-Type Size
condition-may-need-tuple-conversion.patch text/plain 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2018-04-23 10:22:21 Re: wal_consistency_checking reports an inconsistency on master branch
Previous Message Liudmila Mantrova 2018-04-23 09:54:40 Re: documentation is now XML