Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shHOj-00Fh07-Ep for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Aug 2024 23:39:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1shHOh-006lTt-6Z for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Aug 2024 23:39:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shHOg-006lTl-U8 for pgsql-bugs@lists.postgresql.org; Thu, 22 Aug 2024 23:39:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shHOf-000yUH-1H for pgsql-bugs@lists.postgresql.org; Thu, 22 Aug 2024 23:39:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 47MNdF8g2095918; Thu, 22 Aug 2024 19:39:15 -0400 From: Tom Lane To: David Rowley cc: Robert Haas , Maxim Boguk , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18588: Cannot force/let database use parallel execution in simple case. In-reply-to: References: <18588-204730f9394441a8@postgresql.org> <2059550.1724353316@sss.pgh.pa.us> <2073208.1724359323@sss.pgh.pa.us> <2088498.1724367160@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Fri, 23 Aug 2024 11:11:40 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2095916.1724369955.1@sss.pgh.pa.us> Date: Thu, 22 Aug 2024 19:39:15 -0400 Message-ID: <2095917.1724369955@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Fri, 23 Aug 2024 at 10:52, Tom Lane wrote: >> What Maxim is observing is that he's getting I/O concurrency from >> multiple workers; and that's an effect we're simply not accounting >> for here. > I had a look in src/backend/optimizer/README to see if we've defined > what parallel plan costs mean and I didn't see anything under the > "Parallel Query and Partial Paths" heading. I don't see anything in > the header comment to struct Path either. Yeah, it'd be good to have some clarity about that. The whole notion of dividing cost by number of workers seems a little squishy, because we certainly aren't doing less work by having more workers. I guess parallel query has redefined cost as being some measure of elapsed time, which isn't unreasonable but it ought to be written down somewhere. Also, if we're defining it like that, how do we deal with overlap between I/O and computation? regards, tom lane