Re: speedup COPY TO for partitioned table.

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: speedup COPY TO for partitioned table.
Date: 2025-10-03 00:31:31
Message-ID: fac1b2e58e4478e61bca3f5108988051@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-07-30 12:21, jian he wrote:

Hi, Jian

> On Mon, Jul 28, 2025 at 9:22 AM torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
> wrote:
>>
>> I think the behavior for materialized views can be described along
>> with
>> that for partitioned tables. For example:
>>
>> <command>COPY TO</command> can be used with plain
>> tables, populated materialized views and partitioned tables.
>> For example, if <replaceable
>> class="parameter">table</replaceable>
>> is a plain table,
>> <literal>COPY <replaceable class="parameter">table</replaceable>
>> TO</literal> copies the same rows as
>> <literal>SELECT * FROM ONLY <replaceable
>> class="parameter">table</replaceable></literal>.
>>
>> If <replaceable class="parameter">table</replaceable> is a
>> partitioned table or a materialized view,
>> <literal>COPY <replaceable class="parameter">table</replaceable>
>> TO</literal>
>> copies the same rows as <literal>SELECT * FROM <replaceable
>> class="parameter">table</replaceable></literal>.
>>
> Your description seems ok to me.
> Let's see if anyone else has a different take.

It’s been about two months since this discussion, and there don’t seem
to be any further comments.
How about updating the patch accordingly?
If there are no new remarks, I’d like to mark the patch as Ready for
Committer.

>> + List *children = NIL;
>> ...
>> + {
>> + children = find_all_inheritors(RelationGetRelid(rel),
>>
>> Since 'children' is only used inside the else if block, I think we
>> don't
>> need the separate "List *children = NIL;" declaration.
>> Instead, it could just be "List *children =
>> find_all_inheritors(...)".
>>
> you are right.
> ""List *children = find_all_inheritors(...)"." should be ok.

--
Regards,

--
Atsushi Torikoshi
Seconded from NTT DATA Japan Corporation to SRA OSS K.K.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-10-03 00:42:48 Re: [PATCH] Add tests for Bitmapset
Previous Message Peter Smith 2025-10-03 00:04:12 Re: pg_createsubscriber --dry-run logging concerns