RE: POC: postgres_fdw insert batching

Поиск
Список
Период
Сортировка
От tsunakawa.takay@fujitsu.com
Тема RE: POC: postgres_fdw insert batching
Дата
Msg-id OSBPR01MB29820BAA17AD3A79A49935EFFEA40@OSBPR01MB2982.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: POC: postgres_fdw insert batching  (Amit Langote <amitlangote09@gmail.com>)
Ответы Re: POC: postgres_fdw insert batching  (Zhihong Yu <zyu@yugabyte.com>)
Re: POC: postgres_fdw insert batching  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
Tomas-san,

From: Amit Langote <amitlangote09@gmail.com>
> Good thing you reminded me that this is about inserts, and in that
> case no, ExecInitModifyTable() doesn't know all leaf partitions, it
> only sees the root table whose batch_size doesn't really matter.  So
> it's really ExecInitRoutingInfo() that I would recommend to set
> ri_BatchSize; right after this block:
> 
> /*
>  * If the partition is a foreign table, let the FDW init itself for
>  * routing tuples to the partition.
>  */
> if (partRelInfo->ri_FdwRoutine != NULL &&
>     partRelInfo->ri_FdwRoutine->BeginForeignInsert != NULL)
>     partRelInfo->ri_FdwRoutine->BeginForeignInsert(mtstate, partRelInfo);
> 
> Note that ExecInitRoutingInfo() is called only once for a partition
> when it is initialized after being inserted into for the first time.
> 
> For a non-partitioned targets, I'd still say set ri_BatchSize in
> ExecInitModifyTable().

Attached is the patch that added call to GetModifyBatchSize() to the above two places.  The regression test passes.

(FWIW, frankly, I prefer the previous version because the code is a bit smaller...  Maybe we should refactor the code
somedayto reduce similar processings in both the partitioned case and non-partitioned case.)
 


Regards
Takayuki Tsunakawa


Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Deleting older versions in unique indexes to avoid page splits
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Wrong usage of RelationNeedsWAL