Re: minor fix for acquire_inherited_sample_rows

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: minor fix for acquire_inherited_sample_rows
Дата
Msg-id CAFjFpRcpKmeftm5hpmiuJrtUOj+=BRTWANdP3XpZVvzqnAR+PA@mail.gmail.com
обсуждение исходный текст
Ответ на minor fix for acquire_inherited_sample_rows  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: minor fix for acquire_inherited_sample_rows  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
On Mon, Apr 23, 2018 at 3:44 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> 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.

We want to check whether tuple conversion is needed. Theoretically
(not necessarily practically), one could have tuple descs of two
different tables stamped with the same tdtypeid. From that POV,
equalTupleDescs seems to be a stronger check than what you have in the
patch.

BTW the patch you have posted also has a fix you proposed in some
other thread. Probably you want to get rid of it.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: John Naylor
Дата:
Сообщение: lingering references to V0 calling convention
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: Corrupted btree index on HEAD because of covering indexes