Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btvXl-0004JK-Sq for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Oct 2016 11:48:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1btvXl-00035y-CR for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Oct 2016 11:48:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1btvXk-00035s-T8 for pgsql-bugs@postgresql.org; Tue, 11 Oct 2016 11:48:25 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btvXh-00064W-Ju for pgsql-bugs@postgresql.org; Tue, 11 Oct 2016 11:48:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7A60C21C3942 for ; Tue, 11 Oct 2016 14:48:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5DV9VNwF_6D5 for ; Tue, 11 Oct 2016 14:48:19 +0300 (MSK) Received: from [192.168.27.190] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 4E46D21C37E5 for ; Tue, 11 Oct 2016 14:48:19 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1476186499; bh=5sLcNivRU5riVWbJGOeNLsiLD1X9fYeGRmuw+kLuX7o=; h=Subject:To:References:From:Date:In-Reply-To; b=eMm9HSxmLXZFmudhOR9hwOd5jOEdsIZNCLE/usdzGoWBuncWd2srhGEb+ca7fLyue Yls/XDfve9S/KskFSdl96iIfNzEWOLzVT5uwixuEBm9S6VyH08UkAX/sM3GimsY6OX rHLF81DlWoQeT00zh+XqhRqk4qvRyh5qar6xFWlA= Subject: Re: parallel plan in insert query To: pgsql-bugs@postgresql.org References: <2950428a-2b07-03cb-4ec0-7454853fe244@postgrespro.ru> From: Grigory Smolkin Message-ID: Date: Tue, 11 Oct 2016 14:48:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------328524E22BF040906E896507" X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------328524E22BF040906E896507 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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; It does qualify query as 'write query'? On 10/11/2016 02:41 PM, Greg Stark wrote: > The query doesn't look like a write query from the sql or the plan you > sent. My guess is that one of the PostGIS > functions does an update or insert internally. It should probably be > marked VOLATILE in that case which I'm not sure but would assume would > disable parallel queries as well. But there are reasons why they might > not want to do that too in which case this is the kind of risk that > would come with. > > -- Grigory Smolkin Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --------------328524E22BF040906E896507 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

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;

It does qualify query as 'write query'?

On 10/11/2016 02:41 PM, Greg Stark wrote:
The query doesn't look like a write query from the sql or the plan you
sent. My guess is that one of the PostGIS
functions does an update or insert internally. It should probably be
marked VOLATILE in that case which I'm not sure but would assume would
disable parallel queries as well. But there are reasons why they might
not want to do that too in which case this is the kind of risk that
would come with.



-- 
Grigory Smolkin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--------------328524E22BF040906E896507--