pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed[proposal] pg_stat_statements: extension timing instrumentation
2+ messages / 1 participants
[nested] [flat]
* [proposal] pg_stat_statements: extension timing instrumentation
@ 2018-09-29 12:48 legrand legrand <legrand_legrand@hotmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: legrand legrand @ 2018-09-29 12:48 UTC (permalink / raw)
To: pgsql-general
Don't you have been surprised by the duration of a query (seen in psql with
\timing)
and the duration for the same query found in pgss ?
It seems that writting the first query text to file takes some time,
that high execution rate on the same query could generate waits on locks
as when pgss is under pressure with too much distinct queries to store
compared
to the max statements allowed.
All those "waits" are co-located in pgss_store function. What about adding a
pgss_time counter
in pgss to measure the duration of pgss_store (a guc could be added to
enable/disable this) ?
Knowing that there are also plans to add a planing counter in PG12, I would
suggest to add
plan_time,
exec_time,
pgss_time
the sum of those 3 counters being total_time.
This could help in investigating write contentions in pg_stat_statements
query file,
helping to define that max queries should be increased, ...
A prototype is available on demand.
Regards
PAscal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [proposal] pg_stat_statements: extension timing instrumentation
@ 2018-10-21 22:14 legrand legrand <legrand_legrand@hotmail.com>
parent: legrand legrand <legrand_legrand@hotmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: legrand legrand @ 2018-10-21 22:14 UTC (permalink / raw)
To: pgsql-general
An other way is to use "waits" reporting ...
something like :
pgss_store (...)
pgstat_report_wait_start(PG_WAIT_EXTENSION);
...
pgstat_report_wait_end();
gives waits of type "Extension", name "Extension" when spending time in this
part of pgss.
This can help those working with waits sampling
as found in pg_stat_activity, pg_wait_sampling or pgsentinel.
note: some of the contentions are already reported as "LWLock" /
"pg_stat_statements"
Regards
PAscal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-10-21 22:14 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-29 12:48 [proposal] pg_stat_statements: extension timing instrumentation legrand legrand <legrand_legrand@hotmail.com>
2018-10-21 22:14 ` legrand legrand <legrand_legrand@hotmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox