Re: Custom explain options

From: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Custom explain options
Date: 2023-11-30 04:59:32
Message-ID: 7ec74d8a-809b-4fac-884a-96ea6a96735c@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21/10/2023 19:16, Konstantin Knizhnik wrote:
> EXPLAIN statement has a list of options (i.e. ANALYZE, BUFFERS,
> COST,...) which help to provide useful details of query execution.
> In Neon we have added PREFETCH option which shows information about page
> prefetching during query execution (prefetching is more critical for Neon
> architecture because of separation of compute and storage, so it is
> implemented not only for bitmap heap scan as in Vanilla Postgres, but
> also for seqscan, indexscan and indexonly scan). Another possible
> candidate  for explain options is local file cache (extra caching layer
> above shared buffers which is used to somehow replace file system cache
> in standalone Postgres).
>
> I think that it will be nice to have a generic mechanism which allows
> extensions to add its own options to EXPLAIN.

Generally, I welcome this idea: Extensions can already do a lot of work,
and they should have a tool to report their state, not only into the log.
But I think your approach needs to be elaborated. At first, it would be
better to allow registering extended instruments for specific node types
to avoid unneeded calls.
Secondly, looking into the Instrumentation usage, I don't see the reason
to limit the size: as I see everywhere it exists locally or in the DSA
where its size is calculated on the fly. So, by registering an extended
instrument, we can reserve a slot for the extension. The actual size of
underlying data can be provided by the extension routine.

--
regards,
Andrei Lepikhov
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-11-30 05:45:23 possibility to define only local cursors
Previous Message Peter Eisentraut 2023-11-30 04:50:27 Re: should check collations when creating partitioned index