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 1upwrM-00Erm5-HY for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Aug 2025 22:37:17 +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 1upwrL-00H3IH-LB for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Aug 2025 22:37:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1upwrL-00H3I9-C5 for pgsql-hackers@lists.postgresql.org; Sat, 23 Aug 2025 22:37:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1upwrG-001VYi-28 for pgsql-hackers@lists.postgresql.org; Sat, 23 Aug 2025 22:37: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 57NMb8SJ052164; Sat, 23 Aug 2025 18:37:08 -0400 From: Tom Lane To: Chao Li cc: pgsql-hackers@lists.postgresql.org Subject: Re: Improve hash join's handling of tuples with null join keys In-reply-to: <659B2B36-C0FE-4642-921D-E7120E838891@gmail.com> References: <3061845.1746486714@sss.pgh.pa.us> <496221.1748882849@sss.pgh.pa.us> <175507656113.993.1381684440543440253.pgcf@coridan.postgresql.org> <544D7C83-CECE-44E7-B5D7-530E9318D231@gmail.com> <616751.1755276726@sss.pgh.pa.us> <5C5EE031-F086-4353-A17A-DA563CD24DDD@gmail.com> <463296.1755553046@sss.pgh.pa.us> <659B2B36-C0FE-4642-921D-E7120E838891@gmail.com> Comments: In-reply-to Chao Li message dated "Tue, 19 Aug 2025 08:58:47 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <52162.1755988628.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 23 Aug 2025 18:37:08 -0400 Message-ID: <52163.1755988628@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bug #19030 [1] seems to be a fresh report of the problem this patch aims to solve. While answering that, I realized that the v2 patch causes null-keyed inner rows to not be included in EXPLAIN ANALYZE's report of the number of rows output by the Hash node. Now on the one hand, what it's reporting is an accurate reflection of the number of rows in the hash table, which perhaps is useful. On the other hand, it's almost surely going to confuse users, and it's different from the number we produced before. Should we try to preserve the old behavior here? (I've not looked at what code changes would be needed for that.) regards, tom lane [1] https://www.postgresql.org/message-id/flat/19030-944dd78d7ef94c0f%40po= stgresql.org