Re: Allow auto_explain to log plans before queries are executed

From: legrand legrand <legrand_legrand(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow auto_explain to log plans before queries are executed
Date: 2020-02-27 17:37:47
Message-ID: 1582825067004-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

that feature for dumping plans with auto explain is already available in
https://github.com/legrandlegrand/pg_stat_sql_plans

This is an hybrid extension combining auto_explain and pg_stat_statements,
adding a planid and tracking metrics even on error, ..., ...

With
pg_stat_sql_plans.track_planid = true
pg_stat_sql_plans.explain = true
--> it writes explain plan in log file after planning and only one time
per (queryid,planid)
then no need of sampling

and with
pg_stat_sql_plans.track = 'all'
--> function pgssp_backend_queryid(pid) retrieves (nested) queryid of a
stuck statement,
and permit to retrieve its plan (by its queryid) in logs.

Regards
PAscal

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-02-27 18:01:00 pgbench: option delaying queries till connections establishment?
Previous Message Peter Geoghegan 2020-02-27 17:33:42 Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.