Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5d6O-0004xu-06 for pgsql-performance@arkaria.postgresql.org; Thu, 27 Sep 2018 20:41:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5d6M-0008NL-9G for pgsql-performance@arkaria.postgresql.org; Thu, 27 Sep 2018 20:41:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5d6M-0008NB-24 for pgsql-performance@lists.postgresql.org; Thu, 27 Sep 2018 20:41:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5d6J-0007pf-TN for pgsql-performance@postgresql.org; Thu, 27 Sep 2018 20:41:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8RKfTYT022617; Thu, 27 Sep 2018 16:41:29 -0400 From: Tom Lane To: Vladimir Ryabtsev cc: ranade@nodalexchange.com, pgsql-performance@postgresql.org Subject: Re: SELECT statement returns in 10seconds, but INSERT/CREATE TABLE AS with same SELECT takes 7 minutes In-reply-to: References: <24273.1538068894@sss.pgh.pa.us> Comments: In-reply-to Vladimir Ryabtsev message dated "Thu, 27 Sep 2018 13:39:32 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22615.1538080889.1@sss.pgh.pa.us> Date: Thu, 27 Sep 2018 16:41:29 -0400 Message-ID: <22616.1538080889@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Vladimir Ryabtsev writes: >> The reason for the plan shape difference is probably that the bare SELECT >> is allowed to use parallelism while INSERT/SELECT isn't. > In case parallelism is used, should it report in the plan as something like > "workers planned: N"? It did --- see the Gather node. regards, tom lane