pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Grigory Smolkin <g.smolkin@postgrespro.ru>
Cc: pgsql-bugs@postgresql.org
Subject: Re: parallel plan in insert query
Date: Tue, 11 Oct 2016 09:00:52 -0400
Message-ID: <21109.1476190852@sss.pgh.pa.us> (raw)
In-Reply-To: <a5193373-f255-322e-415a-84d92d562843@postgrespro.ru>
References: <2950428a-2b07-03cb-4ec0-7454853fe244@postgrespro.ru>
	<CAM-w4HNETsJS0+KPwF-ar7FRiSdz9PmM9A=XCAVL6gqxEkukEQ@mail.gmail.com>
	<a5193373-f255-322e-415a-84d92d562843@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Grigory Smolkin <g.smolkin@postgrespro.ru> writes:
> It`s INSERT:
> 2016-10-07 19:41:41 MSK [11404]: [78416-1] 
> user=gis,db=gis,app=psql,client=[local] STATEMENT:
> explain analyze insert into edges_snapped_speeds select gid, speed*3600, 
> ts from (select * from traffic_snapped_tracks limit 2) a join lateral 
> snaptopgr(geom) on true;

No, it isn't:

2016-10-07 19:41:41 MSK [11404]: [78414-1] user=gis,db=gis,app=psql,client=[local] ERROR:  cannot start commands during a parallel operation
2016-10-07 19:41:41 MSK [11404]: [78415-1] user=gis,db=gis,app=psql,client=[local] CONTEXT:  SQL statement "SELECT proj4text FROM spatial_ref_sys WHERE srid = 4326 LIMIT 1"
2016-10-07 19:41:41 MSK [11404]: [78416-1] user=gis,db=gis,app=psql,client=[local] STATEMENT:  explain analyze insert into edges_snapped_speeds select gid, speed*3600, ts from (select * from traffic_snapped_tracks limit 2) a join lateral snaptopgr(geom) on true;

This is somewhere down inside a SELECT issued by a called function.
Apparently you've got multiple levels of nested SQL operations there.  The
outer INSERT wouldn't get parallelized, but a query planned and executed
inside a called function could be.

I concur with Greg's conclusion that somewhere in the stack there's a
function marked PARALLEL SAFE that shouldn't be marked that way.
But we don't have nearly enough details to identify it.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <21109.1476190852@sss.pgh.pa.us>
Permalink:  ../21109.1476190852@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21109.1476190852@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, g.smolkin@postgrespro.ru
  Subject: Re: parallel plan in insert query
  In-Reply-To: <21109.1476190852@sss.pgh.pa.us>
  References: <2950428a-2b07-03cb-4ec0-7454853fe244@postgrespro.ru> <CAM-w4HNETsJS0+KPwF-ar7FRiSdz9PmM9A=XCAVL6gqxEkukEQ@mail.gmail.com> <a5193373-f255-322e-415a-84d92d562843@postgrespro.ru> <21109.1476190852@sss.pgh.pa.us>

* 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