Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans) - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)
Date
Msg-id CAH2-WznDG2u+sDRne2Leu5YZAzp0r325jnqOdWwVkwcpFSxbYQ@mail.gmail.com
Whole thread Raw
In response to Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)
List pgsql-hackers
On Wed, Aug 28, 2024 at 9:35 AM Robert Haas <robertmhaas@gmail.com> wrote:
> > If you think it's important to have this info on all indexes then I'd
> > prefer the pgstat approach over adding a field in IndexScanDescData.
> > If instead you think that this is primarily important to expose for
> > nbtree index scans, then I'd prefer putting it in the BTSO using e.g.
> > the index AM analyze hook approach, as I think that's much more
> > elegant than this.
>
> I agree with this analysis. I don't see why IndexScanDesc would ever
> be the right place for this.

Then what do you think is the right place?

There's no simple way to get to the planstate instrumentation from
within an index scan. You could do it by passing it down as an
argument to either ambeginscan or amrescan. But, realistically, it'd
probably be better to just add a pointer to the instrumentation to the
IndexScanDesc passed to amrescan. That's very close to what I've done
already.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: PG_TEST_EXTRA and meson
Next
From: Robert Haas
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands