Re: speedup COPY TO for partitioned table.

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: torikoshia <torikoshia@oss.nttdata.com>, Álvaro Herrera <alvherre@kurilemu.de>, Kirill Reshke <reshkekirill@gmail.com>, vignesh C <vignesh21@gmail.com>, David Rowley <dgrowleyml@gmail.com>, Melih Mutlu <m.melihmutlu@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-16T02:56:28Z
Lists: pgsql-hackers

Attachments

On Thu, Oct 16, 2025 at 9:21 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> > Please check the attached v18.
>
> Thank you for updating the patch!
>
> I've reviewed the patch and here is one review comment:
>
>             from->inh = false;  /* apply ONLY */
> +           if (get_rel_relkind(relid) == RELKIND_PARTITIONED_TABLE)
> +               from->inh = true;
>
> It's better to check rel->rd_rel->relkind instead of calling
> get_rel_relkind() as it checks syscache.
>
> I've attached a patch to fix the above and includes some cosmetic
> changes. Please review it.
>

hi.

overall looks good to me, thanks for polishing it.

+ * However, when copying data from a partitioned table, we don't
+ * not use "ONLY", since we need to retrieve rows from its
+ * descendant tables too.

I guess here it should be
"we don't use "ONLY"
?

I’ve incorporated your changes into v19.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Support COPY TO for partitioned tables.

  2. Re-implement the ereport() macro using __VA_ARGS__.