Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOv4U-0008KG-L9 for pgsql-committers@arkaria.postgresql.org; Wed, 24 Mar 2021 04:24:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOv4S-00036J-EZ for pgsql-committers@arkaria.postgresql.org; Wed, 24 Mar 2021 04:24:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOv4R-00036A-Hr for pgsql-committers@lists.postgresql.org; Wed, 24 Mar 2021 04:24:40 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOv4M-0004ju-NA for pgsql-committers@lists.postgresql.org; Wed, 24 Mar 2021 04:24:37 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id D26FC10A9; Wed, 24 Mar 2021 00:24:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 24 Mar 2021 00:24:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=OGUZMzzxtVvX7eG4qlCBjJPAHfD TeMCpGX894Bj8DHY=; b=VYge6O8RSHdWOkCY6nhrDhh+P70XjvfUuxb0xiAw1SS Va5NyPfURRoYtKuDdN+I8ftyIN3d/yVU4xsUr9WecKLoY4Ml76T9rUWd4/BMeNWT 4xGzP20PCQRwp19Z0AurwDknzNt/Ksj7cCzbOtUzL4msAaKNadDk5OQF9vxekiny IZVmuqb85e5WWAGEWvKd4qrRjOXns4Bp7r1DzRPYJHIsis8LancdAFx4Yp/0oh+v fR1YlRSFYsvxNBRJR+rBjAZcVlmBVVIwIuOV92XxMkB/KihCu3nRbctgFtaQFDoq bJ4cXeF09kYH3OCcKxSKb+6xyoHO3XV1wwxpSXtC5Fw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=OGUZMz zxtVvX7eG4qlCBjJPAHfDTeMCpGX894Bj8DHY=; b=HRVSwl7lJlHSye2XCu8rY/ rSV7I0+7DpMP1ssdLngeTebNtmSIBXEJd3LDPkGbBUU1Avi0zAc+VfsfiRFjeq5e E0gk129paUMdBv6BIGiamfqvSP3YLdUmxCfmxMK1IL2P2iGtA41rRSttThc9DfAs xtUOCTt0D8/I9yppdHCaGFjCAqjfTzYAXM9Ct+TniaKzRSneUAATs+crRFC1mtoq KdKqfC0miE2T6mDBX/ZCNXNA8z08jZPwFp2beISJ19fO9u+Xt2wVhfHu52s/BfJQ 9+S9d7dayn+ixczgldY3loQLnzs2+YfMLihIAr+X2grDHcePj7bA3MumqwhrBBHA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegjedgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucfkphepieejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdr uggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id D4D1924033F; Wed, 24 Mar 2021 00:24:30 -0400 (EDT) Date: Tue, 23 Mar 2021 21:24:29 -0700 From: Andres Freund To: Greg Nancarrow Cc: Robert Haas , Amit Kapila , pgsql-committers Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode Message-ID: <20210324042429.drhhe3xau3qdvald@alap3.anarazel.de> References: <20210323184406.fv7jh5j722ala5lz@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-03-24 14:42:44 +1100, Greg Nancarrow wrote: > On Wed, Mar 24, 2021 at 5:44 AM Andres Freund wrote: > > Shouldn't we have this in IndexOptInfo already? > > The additional parallel-safety checks are (at least currently) invoked > as part of max_parallel_hazard(), which is called early on in the > planner, so I don't believe that IndexOptInfo/RelOptInfo has been > built at this point. Then that's something you need to redesign, not duplicate the effort. > > But also, why on earth > > is that WARNING branch a good idea? > I think there are about half a dozen other places in the Postgres code > where the same check is done, in which case it calls elog(ERROR,...). > Is it a better strategy to immediately exit the backend with an error > in this case, like the other cases do? Yes. > My take on it was that if this "should never happen" condition is ever > encountered, let it back out of the parallel-safety checks and > error-out in the place it normally (currently) would. What advantage does that have? You'll get a bunch of WARNINGs before the ERROR later in optimize, differences between assert-non/assert builds, more complicated code flow, longer untested code. Greetings, Andres Freund