Show hashed SAOP decision in EXPLAIN
Andrei Lepikhov <lepihov@gmail.com>
From: Andrei Lepikhov <lepihov@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2026-06-09T09:51:07Z
Lists: pgsql-hackers
Attachments
- v0-0001-Show-hashed-ScalarArrayOpExpr-decision-in-EXPLAIN.patch (text/plain) patch v0-0001
Hi, This is a follow-up to [1]. EXPLAIN already shows when an operation relies on a hash table — hashed SubPlan, HashAggregate, HashSetOp — which helps users understand a plan's performance. A hashed ScalarArrayOpExpr is the exception: it deparses exactly like the linear form, so EXPLAIN gives no indication of which strategy the executor will use. That is worth surfacing. The array can be long and the comparison runs as a scan filter, so whether the executor builds a hash table or falls back to a linear search has a real cost. The attached patch marks the hashed case. Making the decision visible also makes it testable, so the patch adds regression tests that fill the test gap left by commit 06e94eccfd9, which taught the planner to re-check hashability for container-type equality but added no tests of its own. [1] https://www.postgresql.org/message-id/570738.1780934420%40sss.pgh.pa.us -- regards, Andrei Lepikhov, pgEdge
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix missed checks for hashability of container-type equality.
- 06e94eccfd91 19 (unreleased) cited