Re: Fast COPY FROM based on batch insert

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Re: Fast COPY FROM based on batch insert
Дата
Msg-id CAPmGK15jd6gEt_XyswQ4uEG6XVdz9DNC5uqW1KK=1A_ehLTEYw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fast COPY FROM based on batch insert  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Ответы Re: Fast COPY FROM based on batch insert  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Re: Fast COPY FROM based on batch insert  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Список pgsql-hackers
On Fri, Jul 22, 2022 at 3:39 PM Andrey Lepikhov
<a.lepikhov@postgrespro.ru> wrote:
> Analyzing multi-level heterogeneous partitioned configurations I
> realized, that single write into a partition with a trigger will flush
> buffers for all other partitions of the parent table even if the parent
> haven't any triggers.
> It relates to the code:
> else if (insertMethod == CIM_MULTI_CONDITIONAL &&
>    !CopyMultiInsertInfoIsEmpty(&multiInsertInfo))
> {
>    /*
>     * Flush pending inserts if this partition can't use
>     * batching, so rows are visible to triggers etc.
>     */
>    CopyMultiInsertInfoFlush(&multiInsertInfo, resultRelInfo);
> }
>
> Why such cascade flush is really necessary, especially for BEFORE and
> INSTEAD OF triggers?

BEFORE triggers on the chosen partition might query the parent table,
not just the partition, so I think we need to do this so that such
triggers can see all the rows that have been inserted into the parent
table until then.

Best regards,
Etsuro Fujita



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

Предыдущее
От: Junwang Zhao
Дата:
Сообщение: Re: [PATCH v1] eliminate duplicate code in table.c
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Remove useless arguments in ReadCheckpointRecord().