Re: Batch insert in CTAS/MatView code

From: Paul Guo <pguo(at)pivotal(dot)io>
To: David Fetter <david(at)fetter(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, Taylor Vesely <tvesely(at)pivotal(dot)io>
Subject: Re: Batch insert in CTAS/MatView code
Date: 2019-03-13 02:39:11
Message-ID: CAEET0ZEKrYucm-3mafMwfiV5+o=kDy7rf37JJkKjOco=4bzQKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 11, 2019 at 2:58 AM David Fetter <david(at)fetter(dot)org> wrote:

> On Wed, Mar 06, 2019 at 10:06:27PM +0800, Paul Guo wrote:
> > Hello, Postgres hackers,
> >
> > The copy code has used batch insert with function heap_multi_insert() to
> > speed up. It seems that Create Table As or Materialized View could
> leverage
> > that code also to boost the performance also. Attached is a patch to
> > implement that.
>
> This is great!
>
> Is this optimization doable for multi-row INSERTs, either with tuples
> spelled out in the body of the query or in constructs like INSERT ...
> SELECT ...?
>

Yes. That's "batch insert" in the ModifyTable nodes which I mentioned in
the first email.
By the way, batch is a usual optimization mechanism for iteration kind
model (like postgres executor),
so batch should benefit many executor nodes in theory also.

>
> Best,
> David.
> --
> David Fetter <david(at)fetter(dot)org>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__fetter.org_&d=DwIBAg&c=lnl9vOaLMzsy2niBC8-h_K-7QJuNJEsFrzdndhuJ3Sw&r=Usi0ex6Ch92MsB5QQDgYFw&m=wgGDTDFzZV7nnMm0NFt-yGKmm_KZk18RXKP9HL8h6UE&s=tnaoLdajjR0Ew-93XUliHW1FUspVl09pIFd9aXxvqc8&e=
> Phone: +1 415 235 3778
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-03-13 02:52:07 Re: WIP: Avoid creation of the free space map for small tables
Previous Message Michael Paquier 2019-03-13 02:21:59 Re: pgsql: Add support for hyperbolic functions, as well as log10().