Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)
Date: 2024-08-27 19:13:11
Message-ID: CAH2-Wz=ryRkm=85q-f6CBVh0vbrq1JCjwBFhzCu_enVEUDifWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 27, 2024 at 3:04 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> TBH, I'm afraid that this patch basically is exposing numbers that
> nobody but Peter Geoghegan and maybe two or three other hackers
> will understand, and even fewer people will find useful (since the
> how-many-primitive-scans behavior is not something users have any
> control over, IIUC).

You can make about the same argument against showing "Buffers". It's
not really something that you can address directly, either. It's
helpful only in the context of a specific problem.

> I doubt that "it lines up with
> pg_stat_all_indexes.idx_scan" is enough to justify the additional
> clutter in EXPLAIN.

The scheme laid out in the patch is just a starting point for
discussion. I just think that it's particularly important that we have
this for skip scan -- that's the part that I feel strongly about.

With skip scan in place, every scan of the kind we'd currently call a
"full index scan" will be eligible to skip. Whether and to what extent
we actually skip is determined at runtime. We really need some way of
determining how much skipping has taken place. (There are many
disadvantages to having a dedicated skip scan index path, which I can
go into if you want.)

> Maybe we should be going the other direction
> and trying to make pg_stat_all_indexes count in a less detailed but
> less surprising way, ie once per indexscan plan node invocation.

Is that less surprising, though? I think that it's more surprising.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-08-27 19:55:35 Re: Add contrib/pg_logicalsnapinspect
Previous Message Robert Haas 2024-08-27 19:11:15 Re: allowing extensions to control planner behavior