Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiNUN-0005U9-0b for pgsql-performance@arkaria.postgresql.org; Fri, 20 Dec 2019 18:59:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiNUL-0001C9-SY for pgsql-performance@arkaria.postgresql.org; Fri, 20 Dec 2019 18:59:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiNUL-0001C2-GA for pgsql-performance@lists.postgresql.org; Fri, 20 Dec 2019 18:59:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iiNUJ-0000zI-9u for pgsql-performance@postgresql.org; Fri, 20 Dec 2019 18:59:00 +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 xBKIwvCb011003; Fri, 20 Dec 2019 13:58:58 -0500 From: Tom Lane To: Jeff Janes cc: "pgsql-performa." Subject: Re: How to set parallel_tuple_cost In-reply-to: References: Comments: In-reply-to Jeff Janes message dated "Fri, 20 Dec 2019 13:03:29 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11001.1576868337.1@sss.pgh.pa.us> Date: Fri, 20 Dec 2019 13:58:57 -0500 Message-ID: <11002.1576868337@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeff Janes writes: > The docs for parallel_tuple_cost are quite terse, as the reference section > of the docs usually are: > "Sets the planner's estimate of the cost of transferring one tuple from a > parallel worker process to another process. The default is 0.1." > If you were take the doc description literally, then the default value > seems much too high, as it doesn't take 10x the (default) cpu_tuple_cost to > transfer a tuple up from a parallel worker. Really? If anything, I'd have thought it might be worse than 10x. Cross-process communication isn't cheap, at least not according to my instincts. > On the other hand, you > probably don't want a query which consumes 8x the CPU resources just to > finish only 5% faster (on an otherwise idle server with 8 CPUs). Maybe > this Amdahl factor is what inspired the high default value? I think the large value of parallel_setup_cost is what's meant to discourage that scenario. regards, tom lane