RE: Plan an inner join as a semijoin under eager deduplication

From: William Bernbaum <wbernbaum(at)dwdev(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "guofenglinux(at)gmail(dot)com" <guofenglinux(at)gmail(dot)com>
Subject: RE: Plan an inner join as a semijoin under eager deduplication
Date: 2026-08-31 01:05:50
Message-ID: PH0PR18MB44434B2841710BA0CA162BF4A6A92@PH0PR18MB4443.namprd18.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Here is v2:

- 0008 no longer sets aside and restores cached selectivity. It now marks
the pass on PlannerInfo and bypasses the cache while the mark is set.
This covers the per-subclause selectivities an OR clause caches, which
v1 of this series missed.

- EagerAggMode replaces the booleans and empty list checks previously
threaded through the series.

- Deduplication paths are created with AGGSPLIT_SIMPLE, so they are
costed as plain groupings and print without a Partial label. The function
that relabeled them is gone.

- Because the mode is now explicit, 0015 also reaches a plain
deduplication. Two plans lose a repeated grouping.

- 0012 is new. It splits the construction of GroupingExprInfos out of
create_grouping_expr_infos(). This is the only change in patch count.

Thanks,
Will

Attachment Content-Type Size
v2-0001-Stop-assuming-eager-aggregation-always-has-an-agg.patch application/octet-stream 8.6 KB
v2-0002-Name-the-grouping-clause-for-eager-aggregation.patch application/octet-stream 6.9 KB
v2-0003-Give-eager-deduplication-its-own-usefulness-thres.patch application/octet-stream 8.0 KB
v2-0004-Push-a-deduplication-below-the-joins-for-DISTINCT.patch application/octet-stream 1.9 KB
v2-0005-Take-a-pushed-down-deduplication-as-the-DISTINCT-.patch application/octet-stream 1.5 KB
v2-0006-Fold-in-a-deduplication-at-every-join-level.patch application/octet-stream 33.8 KB
v2-0007-Detect-a-join-input-that-only-filters-the-other-s.patch application/octet-stream 2.5 KB
v2-0008-Allow-a-costing-pass-to-examine-clauses-under-a-s.patch application/octet-stream 3.9 KB
v2-0009-Deduplicate-via-semijoin.patch application/octet-stream 7.0 KB
v2-0010-Give-the-existence-check-a-driver-to-probe-with.patch application/octet-stream 13.4 KB
v2-0011-Compute-aggregates-above-a-pushed-down-deduplicat.patch application/octet-stream 5.6 KB
v2-0012-Construct-grouping-key-infos-from-their-SortGroup.patch application/octet-stream 3.4 KB
v2-0013-Derive-grouping-keys-from-aggregates-carrying-DIS.patch application/octet-stream 33.8 KB
v2-0014-Deduplicate-under-idempotent-aggregates.patch application/octet-stream 16.4 KB
v2-0015-Drop-a-deduplication-repeated-by-the-query-s-own-.patch application/octet-stream 6.7 KB
v2-0016-Test-deduplication-where-something-else-needs-the.patch application/octet-stream 18.5 KB
v2-0017-Test-deduplication-under-non-deterministic-collat.patch application/octet-stream 5.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-08-31 01:47:20 Re: timeout value overflow in wait for lsn
Previous Message Sami Imseih 2026-08-31 00:21:07 Re: Add starelid, attnum to pg_stats and leverage this in pg_dump