Re: Parallel INSERT (INTO ... SELECT ...)

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Parallel INSERT (INTO ... SELECT ...)
Дата
Msg-id CALj2ACU22MVkA82VgajTBNQsVUvMLBJeVdRdCn2=rezAJfZxEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel INSERT (INTO ... SELECT ...)  (Greg Nancarrow <gregn4422@gmail.com>)
Ответы Re: Parallel INSERT (INTO ... SELECT ...)  (Greg Nancarrow <gregn4422@gmail.com>)
Список pgsql-hackers
On Tue, Oct 6, 2020 at 3:08 PM Greg Nancarrow <gregn4422@gmail.com> wrote:
>
> I have not found issues with partition tables (yet) or toast column values.
>

I think for toast column values there may not be a problem as each
parallel worker inserts toast column values individually.

But the problem may arise if a partitioned table has foreign table as
a partition, I think we can not allow parallelism for this case too,
but it's hard to determine ahead of time whether a table has a foreign
partition.(See [1] in copy.c)

>
> - Added support for before/after statement-level INSERT triggers
> (can't allow parallel workers to execute these)
>

I think we can allow parallelism for before statement level-triggers.
Leader can execute this trigger and go for parallel inserts.

How about before row, after row, instead row, new table type triggers?

[1]
    else
    {
        /*
         * For partitioned tables, we may still be able to perform bulk
         * inserts.  However, the possibility of this depends on which types
         * of triggers exist on the partition.  We must disable bulk inserts
         * if the partition is a foreign table or it has any before row insert
         * or insert instead triggers (same as we checked above for the parent
         * table).  Since the partition's resultRelInfos are initialized only
         * when we actually need to insert the first tuple into them, we must
         * have the intermediate insert method of CIM_MULTI_CONDITIONAL to
         * flag that we must later determine if we can use bulk-inserts for
         * the partition being inserted into.
         */
        if (proute)
            insertMethod = CIM_MULTI_CONDITIONAL;

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: pg_upgrade analyze script
Следующее
От: Magnus Hagander
Дата:
Сообщение: Prevent printing "next step instructions" in initdb and pg_upgrade