Poc: pg_stat_statements with planid

From: legrand legrand <legrand_legrand(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Poc: pg_stat_statements with planid
Date: 2018-03-29 19:52:38
Message-ID: 1522353158789-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Hackers

As described in
http://www.postgresql-archive.org/pg-stat-statements-HLD-for-futur-developments-td6012381.html

here is a proposal to add a planid identifier to pg_stat_statements.
The new key for the view is userid, dbid, queryid, planid.

planid is calculated using code from pg_stat_plans extension.

This proposal also include columns :
- created,
- last_updated
from
http://www.postgresql-archive.org/PROPOSAL-timestamp-informations-to-pg-stat-statements-td5912306.html

GUC pg_stat_statements.track_plan (boolean) default to true has been added.

Plan id values are:
- 0 for utility statements,
- 1 for non utility statements when track_plan = false;
- value for non utility statements when track_plan = true;

I think this could be an interesting pre-requisite before adding
- sample values for the constants and parameters
- plans
- planning counters
- ...

Feedbacks are wellcome, regarding development, planid calculation, lock
management, interest, ...

Regards
PAscal

pgss_with_planid.patch
<http://www.postgresql-archive.org/file/t348768/pgss_with_planid.patch>
pgss_with_planid.tar
<http://www.postgresql-archive.org/file/t348768/pgss_with_planid.tar>

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-03-29 19:52:40 pgsql: Rewrite the code that applies scan/join targets to paths.
Previous Message Fabien COELHO 2018-03-29 19:39:42 Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors