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 1wUaPB-001HIR-2W for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 01:28:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUaPA-00GvOj-2e for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 01:28:24 +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 1wUaM6-00GsQK-2r for pgsql-hackers@lists.postgresql.org; Wed, 03 Jun 2026 01:25:14 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wUaM5-00000000prO-12uY for pgsql-hackers@postgresql.org; Wed, 03 Jun 2026 01:25:14 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7e6b5737bb2so2838300a34.1 for ; Tue, 02 Jun 2026 18:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780449912; cv=none; d=google.com; s=arc-20240605; b=T/ZzsoAtWdqFf5qJH1T6RZRVsXnS6zYBnkLoF4lFOo+9npi78rj19aI9XLJHRJjZ14 3dizFaDjg6CVxwHH08+DdCmrBAheNmZMJjkR/VuplTkk2XgZS/j8UqTg3hbq0O1UiWCg 85Ewjpywd07Z4ZSQM1sX2u2xXpFJLz/i49ZIw8/cB3ypbz8nJXy3rM4KPyWIzAdzqkYz DxRSdmZHhEE4EpZfDw4526imUsItWsUD4fu4l/LJbC7YL/9KbuDDtpa8w8VNbXdSv+co M/eAbqFcNxQqQja3RFW6qyIVjOylY+HAW5wTDvJ/H0dzKbq8dF7i+47dniNsviE39QFt kZTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Mw2eNFfR5yrfImYvOYPuKwbeJkN0wfRJlc99dgHtpJs=; fh=fp1lyQomKBo3qi+UiIcsuaPLpcTQoZEZBqTmJRu+Joc=; b=ADR6Gvu5tK5CJuO/QDpU9/rwdiJJRb2cGqndxovEq6zJRbCXnhvoMGlaAzbIvJCj0B guZL6LqyxFUD7OTgmu0FSySxFHHu1Rk4wbVDnOJSovPlxEgotmy+TzfxODUNwLryOXUP RQZXnkXXKUwE++9LAhrix5g66SDazYeRUjo8dk8alO2Dr34RpCpBQ9NhZfDQ/yPoFHIF oUSZzzl/98m0Qwe/5phI7JdhfuRVWec1z+UjPXvhx6kko9Kv9BhN7OBowKQWaDPfHFKn jo3xIXeKWsHWUAXAAkLHRUf9q7ucXHdCqN+22CDoA0VroJ+DFLxmxm0WL1XZ/K1MLXc6 Hteg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780449912; x=1781054712; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Mw2eNFfR5yrfImYvOYPuKwbeJkN0wfRJlc99dgHtpJs=; b=jsdNyNxOHPDCbO44XfMxucmJ2BAyygOLQRZA3Xdkv+8setYjqa0jycvZACGRIsQ4rD rbwpL9SsudLdJBsc7SLq9s7+ARJnd62vyDsk0lgBbjXBc6i18C3TJ9VZAlEpM/IfBNBu vDs7OzED1a0SH7oA6BYRSDS+dZ18eXxhL6U2GI56W5BuBy8vCtFw49gjL0y+bFFy9C7M 2yDjaeC057gmoowpC4021U10tTCHRWf1rYU2SqZnBPqBx5e8D22iWUrUreIsf4ZublHY mtJjryeuOY5N1P2WQ+7W7B0ayuWBzSVcYfH3ODrd1X5V/HSQsAT8tpuwPHsuG/9rPpRJ m3vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780449912; x=1781054712; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Mw2eNFfR5yrfImYvOYPuKwbeJkN0wfRJlc99dgHtpJs=; b=ptTDX44sZAMzMKldl74T8DS3Iyz1H0TdjxJ4G6U/VtOg5tm2uJgZAtEyJE4ehUEsTc j5B5sqwtEkmpcEA6TBJc4xCtMSADdHa/Lyhhz8twpc7yaNzHl/g9nneDT9xsdTjDVOhZ ICk8T9Pd+0wLVmRxm9LMfpyAeSDwhari9fzIrNdFJP18D87Xn29qjiL0hFwPt0jPTA18 qdQzeTfomakSsLhdnLy/zgD947uPLpERYOThLmDKrzsa+PZB7rEb8uD08hONVOVCo6gN lmWQk6bU+ov88Uzq1xzV+H5mC3NBFnIb9ZQQSA0G+yTg9N1zpSBexWMzhUBnsBZ6Iy1l IF/A== X-Forwarded-Encrypted: i=1; AFNElJ8TH9bY46fCsnCAd/YLR4CHP65Z7Q8ruA0/2ZoOzKx97ePK4OFEc+bx57H1OvuaHl8VhMURU5vxc20n6VLY@postgresql.org X-Gm-Message-State: AOJu0Yx4cEVTlf8LyEKCs0WFeHHntqhRLtZXBF0kiYvqaWUc/LO1Eb9z eERi3pIm+55g53uV6eFpDZKEp02NO1v5xe8ujVn6ASkq/phPdeZuZEwqHoZYS8xL/uBomfChMwt eDfXmOn8SHIMeH6ReC5kNh03UCp2IsUE= X-Gm-Gg: Acq92OHxbuw617WZyBsFXMOGRzKpMeusMeEYYnZ91/tIebkvfEMeOgn5HhHCfXif7RA n+qMF8zxXBR1MthNRfCGaa0usHwAfREumqB1r07gWnBAyf1+oyaxSLb1JcQGQZI38mzFODOqgg2 XYJBc1IqyT2hOjkhb2g77jELTfUB6lH9SZDjtQzCqoPQznxevDnaoxTFvGtJ213BDVgxLPVj3J/ p0UMZl2SGCkqyNtaoynQeTlgN6tqO75EjDJBOj+32j2pmoE9i7/fCOBJcGmSzytb3EPcjTefATq t62XpnbvFAnSu+5ASYLk X-Received: by 2002:a05:6820:a83:b0:69d:9b0a:bf8a with SMTP id 006d021491bc7-69e4809e2e9mr560441eaf.46.1780449912532; Tue, 02 Jun 2026 18:25:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Guo Date: Wed, 3 Jun 2026 10:25:01 +0900 X-Gm-Features: AVHnY4LabrH7Rx9wsqnqk-EitXBTCSXJ3F19fJR2Q4XaIaF2zRyvXo08KHhpzb0 Message-ID: Subject: Re: Eager aggregation, take 3 To: Tender Wang Cc: Radim Marek , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jun 1, 2026 at 4:57=E2=80=AFPM Tender Wang wro= te: > Richard Guo =E4=BA=8E2026=E5=B9=B46=E6=9C=881=E6= =97=A5=E5=91=A8=E4=B8=80 15:19=E5=86=99=E9=81=93=EF=BC=9A > > So I'd rather fix it in eager_aggregation_possible_for_relation, right > > next to the existing outer-join check, by rejecting a relation that > > lies on the inner side of a semijoin/antijoin. See attached. > The attached LGTM. Thanks for the review. Pushed. And thanks to Radim for the report and the well-contained repro. - Richard