pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <akapila@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: RE: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Date: Tue, 23 Mar 2021 04:27:12 +0000
Message-ID: <TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAA4eK1+vRWCjMyNJKi+Jk=aOVdH0OuD+ShxTFXchHKH8=yTN9Q@mail.gmail.com>
References: <E1lMiB9-0001c3-SY@gemulon.postgresql.org>
	<CA+TgmoY0GdS7POPWB2nG3yiycNeLz05Mw53NunOjn8f8rZZuxw@mail.gmail.com>
	<558385.1616423602@sss.pgh.pa.us>
	<CAA4eK1+vRWCjMyNJKi+Jk=aOVdH0OuD+ShxTFXchHKH8=yTN9Q@mail.gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
> Okay, I can revert this work to avoid that risk but it would be great
> if you can share your thoughts on what alternative design do you have
> in mind, and or how it should be better implemented? Regarding
> performance overhead, it is for partitioned tables with a large number
> of partitions, and that too when the data to insert is not that much
> or there is parallel-unsafe clause on one of the partitions. Now, how
> else can we determine the parallel-safety without checking each of the
> partitions? We do have other partition-related gucs
> (enable_partition*) to avoid the partitions-related overhead so why is
> it so bad to have guc here (maybe the naming of guc/reloption is not
> good)?
> 

I'd love to hear even rough ideas from Robert-san.  I guess something like...:

* Basically, we can assume or hope that all partitions have the same parallel safety as the root partitioned table.  That is, it'd be very rare that child partitions have different indexes, constraints, and triggers.  So, we can just check the root table during planning to decide if we want to run parallel processing.

* When the executor opens a target child partition, it checks its parallel safety only once for it.  If any target partition turns out to be parallel unsafe, have the parallel leader do the insertion shomehow.

TBH, I don't think the parameter is so ugly.  At least, it's not worse than Oracle or SQL Server.





	Regards
Takayuki 	Tsunakawa
						



view thread (37+ messages)  latest in thread

Message-ID: <TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com>
Permalink:  ../TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tsunakawa.takay@fujitsu.com, robertmhaas@gmail.com, amit.kapila16@gmail.com, tgl@sss.pgh.pa.us, akapila@postgresql.org
  Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
  In-Reply-To: <TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com>
  References: <E1lMiB9-0001c3-SY@gemulon.postgresql.org> <CA+TgmoY0GdS7POPWB2nG3yiycNeLz05Mw53NunOjn8f8rZZuxw@mail.gmail.com> <558385.1616423602@sss.pgh.pa.us> <CAA4eK1+vRWCjMyNJKi+Jk=aOVdH0OuD+ShxTFXchHKH8=yTN9Q@mail.gmail.com> <TYAPR01MB299085073EEA19481FB4A86CFE649@TYAPR01MB2990.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox