Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-06T19:12:40Z
Lists: pgsql-hackers
On Thu, Mar 6, 2025 at 1:58 PM Peter Geoghegan <pg@bowt.ie> wrote: > On Thu, Mar 6, 2025 at 1:54 PM Robert Haas <robertmhaas@gmail.com> wrote: > > Hmm, it seems weird that you can't get a hold of that structure to me. > > Why can't you just go find it in the DSM? > > Sorry, I was unclear. > > One reason is that there isn't necessarily anything to find. > Certainly, when I try this out with a debugger, even the B-Tree scan > doesn't have doesn't even have IndexScanDescData.parallel_scan set. It > isn't actually a parallel B-Tree scan. It is a > serial/non-parallel-aware index scan that is run from a parallel > worker, and feeds its output into a gather merge node despite all > this. Well, I think this calls the basic design into question. We discussed putting this into IndexScanDescData as a convenient way of piping it through to EXPLAIN, but what I think we have now discovered is that there isn't actually convenient at all, because every process has its own IndexScanDescData and the leader sees only its own. It seems like what you need is to have each process accumulate stats locally, and then at the end total them up. Maybe show_sort_info() has some useful precedent, since that's also a bit of node-specific instrumentation, and it seems to know what to do about workers. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Show index search count in EXPLAIN ANALYZE, take 2.
- 0fbceae841cb 18.0 landed
-
Show index search count in EXPLAIN ANALYZE.
- 5ead85fbc811 18.0 landed
-
Allow usage of match_orclause_to_indexcol() for joins
- 627d63419e22 18.0 cited
-
Fix nbtree pgstats accounting with parallel scans.
- c00c54a9ac1e 18.0 landed
- fb4f5e58af97 17.0 landed
-
Enhance nbtree ScalarArrayOp execution.
- 5bf748b86bc6 17.0 cited
-
Fix EXPLAIN ANALYZE of hash join when the leader doesn't participate.
- 5bcf389ecfd4 11.0 cited