Re: speedup COPY TO for partitioned table. - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: speedup COPY TO for partitioned table.
Date
Msg-id CAD21AoCP=jtL4mCO3HF=iPF7TYj+4cFtoO4fPajAW_oUchU07g@mail.gmail.com
Whole thread Raw
In response to Re: speedup COPY TO for partitioned table.  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On Thu, Oct 16, 2025 at 3:01 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Wed, Oct 15, 2025 at 7:57 PM jian he <jian.universality@gmail.com> wrote:
> >
> > 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"
> > ?
>
> Right, thank you for pointing it out.
>
> > I’ve incorporated your changes into v19.
>
> Thank you!
>
> I think the patch is in good shape. I've slightly changed the
> documentation changes and updated the commit message. I'm going to
> push the attached patch, if there are no objections or further review
> comments.

Pushed.

Regards

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Next
From: Tom Lane
Date:
Subject: Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()