Re: Allow auto_explain to log plans before queries are executed - Mailing list pgsql-hackers

From legrand legrand
Subject Re: Allow auto_explain to log plans before queries are executed
Date
Msg-id 1582825067004-0.post@n3.nabble.com
Whole thread Raw
In response to Re: Allow auto_explain to log plans before queries are executed  (Julien Rouhaud <rjuju123@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.
Next
From: Andres Freund
Date:
Subject: pgbench: option delaying queries till connections establishment?