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.96) (envelope-from ) id 1wXPOR-003FKl-2G for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Jun 2026 20:19:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXPOP-00CoaP-1g for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Jun 2026 20:19:17 +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.96) (envelope-from ) id 1wXPOP-00CoaH-0c for pgsql-bugs@lists.postgresql.org; Wed, 10 Jun 2026 20:19:17 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXPON-0000000243b-1bWL for pgsql-bugs@lists.postgresql.org; Wed, 10 Jun 2026 20:19:16 +0000 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-516d0db9372so57832221cf.2 for ; Wed, 10 Jun 2026 13:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781122753; x=1781727553; darn=lists.postgresql.org; h=in-reply-to:references:subject:to:from:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ac43eXi4+ePqayomuRMRqb6eGjwaYa08n4wN4DX/qyk=; b=n1JNRaK9m0656GUk1L0obJ1W0H7cteZSRViTw+qgJu7DMCbh9xdkvk88zbWfougR+W 7tlKxjoPr4dmHr7c6PheJU3bIVUnYl+3uH1M34RwxtAhIk2UKx2hV8XJTx5zttHHXBD4 7P0FIZbmTNMYIdBN736Ct5R+CwqjWYBh+NMUEnSHUzbpGz86JdxV+JWsdYetk5Ge6x9Q EriM4CFIVzcp14fO+IGvW8o1LbAdxpURdfMJrVkg1HPD4YX5AvojXnDTrIZxhBfsxk+t ehGbHwxA+XXwkj/NzQ2J2GummztyqbXO2Q2qg/yzwMSB0sNwPtMduMVDuAZU+VKY2zuJ 83nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781122753; x=1781727553; h=in-reply-to:references:subject:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ac43eXi4+ePqayomuRMRqb6eGjwaYa08n4wN4DX/qyk=; b=UrEwrg5QY2MoKeaAWq77qBMl5YixKcOfD+Nlj01fD2nQGZfnRJUviD9mbuKV1cWMqq 536I18YhSJhXZYVvHFMuL1lea9LrJed+mhwFZGeyWf/pwozuHFBiizbEY0wDGVd+OSAf J+ShOlQ/QSigfLu5jBt4TMHKOgh/zqGfumnDVj8l36+MF9Y7qziIM/CbRA77Er1GmO3v b6FbsSr5DliAYPeZOXGIyFVYPOCC8CjOVZjgq3c/lKhMPlqgO1CemqS+MJa+OyMchKq8 lI3kzgNS8hBoLgnSl0oMLju4TEHByLdElUyXTpsrWEFvnWAP34JCqLN8H1ozm0El0q/2 SqDQ== X-Forwarded-Encrypted: i=1; AFNElJ93KfQhFpogZMJS5gYV/LF70Q0cBS6hWDoJqd9PXCd0NU9VStwx+CiA+Y5r0hA938JpqGkQjYQvDOSn@lists.postgresql.org X-Gm-Message-State: AOJu0YxDATnjBpdGZjvayNSimwZdVweOczSMjxRk6vIXzlHTOG/R7M1t zJ23Zaiu/XQDPhM4V52IdoDNg1curr/e3PHoY48lAh057olocVGxqG22 X-Gm-Gg: Acq92OHgoez7ivHKlHtFrailr8GbyXNDsQ3qTuU+g2psf/eLYlxFMUFUpQ/IvKO/U0/ qqkQNdp+CHDpeGssGOoLs/aVOgLbQG+sjZIupPnVElsXCaqghCZ3nTjP07+maY7yHcmZ9ao3aH7 UietiQv9YCXgpurwb0f5iWsxWlucLro+dHbwHVb71hqtKlD8axSMfkxcLZRyvWkdq8mSddpfkcF eyccwW4utsM0ZWB2VqioccdEzbnIm+kGxFUnPMejIO84DMJWUdDYGj5dczk7rrd3VJlMe0ZTyjC 7kGuXFTc9/OT7uXq3QcnjDvDA3a9xact+Z3hDBH9k9CrJglpJLk+nNdsqBEeXFekhs1r70amnc1 jOWSv3ngmCiPCCSREXB/3H+OfVRwk8VgblDGez1uaJHcQxuDF8H/Qxdcu/x1n58tqgWbLKVg3xI aUu12DrqA4gTr8d6BDriR9hm5e7wdCqnMfWEqg7s+HT54BLIKje2676bwm X-Received: by 2002:a05:622a:a991:10b0:517:92e4:4294 with SMTP id d75a77b69052e-51795b74f33mr296275291cf.22.1781122753553; Wed, 10 Jun 2026 13:19:13 -0700 (PDT) Received: from localhost ([2804:14d:328a:a59c:888d:9452:78d0:d981]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8cecd0535b0sm241843866d6.28.2026.06.10.13.19.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2026 13:19:13 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 10 Jun 2026 17:19:09 -0300 Message-Id: From: "Matheus Alcantara" To: , Subject: Re: BUG #19517: Eager Aggregation produces wrong count(*) when pushed into RHS of Hash Semi Join X-Mailer: aerc 0.21.0 References: <19517-4c53dcdcef98d263@postgresql.org> In-Reply-To: <19517-4c53dcdcef98d263@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed Jun 10, 2026 at 12:44 PM -03, PG Bug reporting form wrote: > Likely cause > ------------ > Eager Aggregation appears to consider the RHS of a SEMI/ANTI join a legal > site to push a partial aggregate, but for SEMI joins each outer row match= es > at most one inner row by the join's own semantics, so partial counts take= n > on the inner side cannot be combined into a correct outer-side count(*). > Either eager aggregation must be disabled for the RHS of SEMI/ANTI joins, > or the partial state must be projected through the semi-join such that > each surviving outer row contributes exactly one partial. > > Two follow-up commits to eager aggregation landed on 2026-04-06 > ("Fix volatile function evaluation in eager aggregation" and > "Fix collation handling for grouping keys in eager aggregation"), but > neither addresses semi-join correctness. > Wondering if commit ffeda04259b (Fix eager aggregation for semi/antijoin inner rels) is about fixing this issue. Can you please check it? I think that 19beta1 was created before the fix was applied on master. > Search performed before reporting > --------------------------------- > - pgsql-bugs archives for 2026-04, 2026-05, and 2026-06: no matching > report. > - pgsql-hackers search "eager aggregation semi": 0 hits. > - pgsql-hackers search "eager aggregation bug": only the original > development thread by Richard Guo. > - PostgreSQL 19 Open Items wiki (checked 2026-06-10): not listed under > Open Issues, Resolved before 19beta1/19beta2, Non-bugs, or Won't Fix. > For the reference this previous bug was reported at [1] on eager aggregation thread. [1] https://www.postgresql.org/message-id/CAJgoLk+d_P5sKrx-SZt01Acm_j0QnWn6= aKJzFJ=3DwaRu_3C8AoQ@mail.gmail.com -- Matheus Alcantara EDB: https://www.enterprisedb.com