From: | Tomas Vondra <tomas(at)vondra(dot)me> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | showing hashjoin batches/buckets in EXPLAIN (not ANALYZE) |
Date: | 2025-02-06 22:02:14 |
Message-ID: | 40e88fae-eee0-4a07-a663-7b8354e4cc2e@vondra.me |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
While working on the patches addressing hashjoin batch explosion [1], I
was reminded that we show the estimated nbatch/nbucket values in EXPLAIN
ANALYZE but not in plain EXPLAIN. That makes sense, because we don't
create the hash table until we actually have to (when we start fetching
tuples from the hash join), and explain doesn't get that far, and we
don't want to change that.
But we also calculate the parameters while costing the hashjoin - we
just need to pass the information through Path -> Hash -> HashState, so
that explain has access to that. The attached 0001 patch does that, and
it's pretty simple / non-invasive. Patch 0002 merely adjusts the output
for regression tests affected by 0001.
Paradoxically, this is not particularly helpful for the issues addressed
by [1], because those patches are about execution-time issues, e.g. when
we start adding more and more batches. Still, I think the information is
generally useful/interesting when investigating query plans.
I'm not sure if the batches/buckets should be displayed by default, or
only with VERBOSE or something like that (opinions?).
[1]
https://www.postgresql.org/message-id/7bed6c08-72a0-4ab9-a79c-e01fcdd0940f%40vondra.me
regards
--
Tomas Vondra
Attachment | Content-Type | Size |
---|---|---|
v20250206-0001-add-nbatch-nbucket-to-explain.patch | text/x-patch | 4.6 KB |
v20250206-0002-update-regression-tests.patch | text/x-patch | 460.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Gustafsson | 2025-02-06 22:02:43 | Re: [PoC] Federated Authn/z with OAUTHBEARER |
Previous Message | Daniel Gustafsson | 2025-02-06 21:46:47 | Re: Docs for pg_basebackup needs v17 note for incremental backup |