model-writtenrun 6348 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Apr - May 2020 · 6 entries
- James Coleman proposed binary-search evaluation of constant OR-semantics arrays in #1, reporting a large speedup for long IN lists and restricting the optimization to constants to avoid parameter invalidation machinery.
- Tomas Vondra questioned the nine-element threshold and proposed Bloom filtering in #2, while David Rowley discussed comparison counts in #5 and Andres Freund highlighted cache behavior in #6; the discussion also recognized that preprocessing costs depend on the number of lookups.
- Vondra supplied a benchmarkable binary-search and Bloom-filter series in #9; integer tests showed no Bloom-filter benefit, but later text tests in #11 showed gains when comparisons were expensive.
- Comparisons with IN(VALUES) hash joins led Vondra to recommend a direct hash table in #15, and Coleman confirmed the performance direction in #18 before posting the dynahash implementation in #22.
- Vondra encouraged trying simplehash in #23, and Freund explained its advantages for small entries and cache efficiency in #34; Coleman then supplied the simplehash variant in #39, leaving the earlier implementations as comparison stages.
- Discussion of PL/pgSQL simple expressions in #24, #26, and #27 exposed the risk of paying hash-table setup costs for expressions evaluated only once, without producing a separate implementation for that case.
Aug - Sep 2020 · 1 entry
- Heikki Linnakangas reviewed the simplehash version in #40 and suggested supporting stable nonconstant arrays and cheaper array traversal, but the parameter, variable, and runtime-strategy complications discussed in #42 and #43 left those extensions outside the patch.
Mar - Jul 2021 · 11 entries
- After a long gap, Coleman returned with the consolidated and cleaned-up hashing patch in #44, preserving the constant-array scope.
- Rowley's review in #45 identified potential regressions during constant folding and single-row CHECK evaluation, so he proposed letting the planner select hashing through a new HashedScalarArrayOpExpr wrapper; Vondra independently benchmarked that design in #47.
- Rowley replaced the wrapper with a hashfuncid field in #48 because supporting a new expression node throughout the planner was cumbersome, and added costing, LLVM support, permission checks, and non-strict equality tests.
- After reporting startup-overhead benchmarks in #49, Rowley committed #48 as 50e17ad281 with light cleanup and a catalog-version bump, announcing the landing in #50; CHECK constraints remained outside the planner-selected optimization.
- Vondra's post-commit benchmarks in #55 showed strong gains for repeated lookups but regressions for very small prepared workloads, prompting debate over cardinality estimates and adaptive switching in #56, #57, and #59 without another implementation landing in this thread.
- Rowley proposed extending hashing to NOT IN through the inequality operator's hashable negator in #61, Tom Lane raised NULL semantics in #62, and Coleman favored postponing the extension beyond PostgreSQL 14 in #64.
- Coleman supplied the first NOT IN draft in #65, but Rowley found that it never entered the hashing path because it still requested hash functions for the inequality operator; his replacement in #66 implemented negator lookup and executor inversion while retaining Coleman's tests.
- Coleman reviewed the replacement in #67, but Lane rejected making opfuncid disagree with opno in #69; Rowley responded with the dedicated negfuncid field in #73, preserving the operator's identity while supplying equality semantics for hash probes.
- Zhihong Yu found the incorrect function argument in dependency recording in #74, and Rowley corrected it in #76, also confirming that the NOT IN extension would not be included in PostgreSQL 14.
- Rowley posted final assertion, naming, and comment refinements in #77, then committed that patch as 29f45e299e with a further executor-member rename and catalog-version bump.
- The thread ends with Rowley's landing announcement and thanks to Coleman and Yu in #78; both IN and NOT IN hashing had landed, while nonconstant-array support and more adaptive decisions about hashing remained future work.