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 1t0EX1-00AATi-4Z for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Oct 2024 06:26:15 +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 1t0EWz-00AZpu-9Q for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Oct 2024 06:26:13 +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 1t0EWz-00AZpR-1E for pgsql-bugs@lists.postgresql.org; Mon, 14 Oct 2024 06:26:13 +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 1t0EWw-000mzq-Vu for pgsql-bugs@lists.postgresql.org; Mon, 14 Oct 2024 06:26:12 +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 49E6Q9GX3581841; Mon, 14 Oct 2024 02:26:09 -0400 From: Tom Lane To: Andrei Lepikhov cc: Thomas Munro , Craig Milhiser , pgsql-bugs@lists.postgresql.org Subject: Re: Reference to - BUG #18349: ERROR: invalid DSA memory alloc request size 1811939328, CONTEXT: parallel worker In-reply-to: <96a328e9-4fbf-433b-a8d7-071da18e12c4@gmail.com> References: <6785e9e8-4c64-41b0-9e72-c13d1822b599@gmail.com> <0c3b0e1b-55d1-42b6-8c3c-4392479187db@gmail.com> <9! 6a328e9-4fbf-433b-a8d7-071da18e12c4@gmail.com> Comments: In-reply-to Andrei Lepikhov message dated "Mon, 14 Oct 2024 12:45:09 +0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3581839.1728887169.1@sss.pgh.pa.us> Date: Mon, 14 Oct 2024 02:26:09 -0400 Message-ID: <3581840.1728887169@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrei Lepikhov writes: > My explanation (correct if I'm wrong): > OUTER JOINs allow NULLs to be in a hash table. At the same time, a hash > value for NULL is 0, and it goes to the batch==0. > If batch number 0 gets overfilled, the > ExecParallelHashIncreaseNumBatches routine attempts to increase the > number of batches - but nothing happens. The initial batch is still too > big, and the number of batches doubles up to the limit. Interesting point. If memory serves (I'm too tired to actually look) the planner considers the statistical most-common-value when estimating whether an unsplittable hash bucket is likely to be too big. It does *not* think about null values ... but it ought to. However, this does not explain why PHJ would be more subject to the problem than non-parallel HJ. regards, tom lane