RE: [POC] Fast COPY FROM command for the table with foreign partitions

Поиск
Список
Период
Сортировка
Искать
От
tsunakawa.takay@fujitsu.com
Тема
RE: [POC] Fast COPY FROM command for the table with foreign partitions
Дата
Msg-id
TYAPR01MB299070A2B01D63A31337F105FEF90@TYAPR01MB2990.jpnprd01.prod.outlook.com
Ответ на
Список
Дерево обсуждения
[POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Etsuro Fujita <etsuro.fujita@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreignpartitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreignpartitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Michael Paquier <michael@paquier.xyz>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Alexey Kondratov <a.kondratov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Alexey Kondratov <a.kondratov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Alexey Kondratov <a.kondratov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Tomas Vondra <tomas.vondra@enterprisedb.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Etsuro Fujita <etsuro.fujita@gmail.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Tomas Vondra <tomas.vondra@enterprisedb.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Justin Pryzby <pryzby@telsasoft.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
RE: [POC] Fast COPY FROM command for the table with foreign partitions "Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Alexey Kondratov <a.kondratov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Alexey Kondratov <a.kondratov@postgrespro.ru>
Re: [POC] Fast COPY FROM command for the table with foreign partitions Etsuro Fujita <etsuro.fujita@gmail.com>
Re: [POC] Fast COPY FROM command for the table with foreignpartitions Andrey Lepikhov <a.lepikhov@postgrespro.ru>
From: Amit Langote 
> Second is whether the interface for setting ri_usesMultiInsert
> encourages situations where different modules could possibly engage in
> conflicting behaviors.  I can't think of a real-life example of that
> with the current implementation, but maybe the interface provided in
> the patch makes it harder to ensure that that remains true in the
> future.  Tsunakawa-san, have you encountered an example of this, maybe
> when trying to integrate this patch with some other?

Thanks.  No, I pointed out purely from the standpoint of program modularity (based on structured programming?)


> Anyway, one thing we could do is rename
> ExecRelationAllowsMultiInsert() to ExecSetRelationUsesMultiInsert(),
> that is, to make it actually set ri_usesMultiInsert and have places
> like CopyFrom() call it if (and only if) its local logic allows
> multi-insert to be used.  So, ri_usesMultiInsert starts out set to
> false and if a module wants to use multi-insert for a given target
> relation, it calls ExecSetRelationUsesMultiInsert() to turn the flag
> on.  Also, given the confusion regarding how execPartition.c

I think separating the setting and inspection of the property into different functions will be good, at least.


> manipulates the flag, maybe change ExecFindPartition() to accept a
> Boolean parameter multi_insert, which it will pass down to
> ExecInitPartitionInfo(), which in turn will call
> ExecSetRelationUsesMultiInsert() for a given partition.  Of course, if
> the logic in ExecSetRelationUsesMultiInsert() determines that
> multi-insert can't be used, for the reasons listed in the function,
> then the caller will have to live with that decision.

I can't say for sure, but it looks strange to me, because I can't find a good description of multi_insert argument for ExecFindPartition().  If we add multi_insert, I'm afraid we may want to add further arguments for other properties in the future like "Hey, get me the partition that has triggers.", "Next, pass me a partition that uses a foreign table.", etc.  I think the current ExecFindPartition() is good -- "Get me a partition that accepts this row."

I wonder if ri_usesMultiInsert is really necessary.  Would it cut down enough costs in the intended use case(s), say the heavyweight COPY FROM?


Regards
Takayuki Tsunakawa


В списке pgsql-hackers по дате отправления
От: Craig Ringer
Дата:
От: Alvaro Herrera
Дата:
FAQ