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 1shD4R-00EfsX-Ii for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Aug 2024 19:02:07 +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 1shD4O-004rEN-53 for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Aug 2024 19:02:04 +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 1shD4N-004rEE-TN for pgsql-bugs@lists.postgresql.org; Thu, 22 Aug 2024 19:02:04 +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 1shD4I-000wZW-AO for pgsql-bugs@lists.postgresql.org; Thu, 22 Aug 2024 19:02:03 +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 47MJ1uvr2059551; Thu, 22 Aug 2024 15:01:56 -0400 From: Tom Lane To: Maxim Boguk cc: David Rowley , 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> Comments: In-reply-to Maxim Boguk message dated "Thu, 22 Aug 2024 20:05:50 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2059549.1724353316.1@sss.pgh.pa.us> Date: Thu, 22 Aug 2024 15:01:56 -0400 Message-ID: <2059550.1724353316@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Maxim Boguk writes: > Ok there are reproducer test case on the stock postgresql 16.4 config: Hmm, you can see both behaviors on the small version of t1, just by varying the comparison constant in the WHERE clause. For me, it'll use only one worker with "where a<1", and not parallelize at all with "where a<0". It looks like it's deciding that it's not worth starting workers when too few rows are expected to be returned. That would be unsurprising with a normal setting of parallel_setup_cost, but it does seem odd with parallel_setup_cost=0. In any case, I think this isn't about the big table being big but about changing the range of values of "a", which changes the selectivity of "where a<10" 100-fold. (I tested on HEAD not v16) regards, tom lane