pgsql: Add some infrastructure for contrib/pg_stat_statements.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add some infrastructure for contrib/pg_stat_statements.
Date: 2012-03-27 19:18:06
Message-ID: E1SCbuA-0003M5-2T@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add some infrastructure for contrib/pg_stat_statements.

Add a queryId field to Query and PlannedStmt. This is not used by the
core backend, except for being copied around at appropriate times.
It's meant to allow plug-ins to track a particular query forward from
parse analysis to execution.

The queryId is intentionally not dumped into stored rules (and hence this
commit doesn't bump catversion). You could argue that choice either way,
but it seems better that stored rule strings not have any dependency
on plug-ins that might or might not be present.

Also, add a post_parse_analyze_hook that gets invoked at the end of
parse analysis (but only for top-level analysis of complete queries,
not cases such as analyzing a domain's default-value expression).
This is mainly meant to be used to compute and assign a queryId,
but it could have other applications.

Peter Geoghegan

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a40fa613b516b97c37d87ac1b21fb7aa8a2f2c1b

Modified Files
--------------
src/backend/nodes/copyfuncs.c | 2 ++
src/backend/nodes/equalfuncs.c | 1 +
src/backend/nodes/outfuncs.c | 2 ++
src/backend/nodes/readfuncs.c | 1 +
src/backend/optimizer/plan/planner.c | 1 +
src/backend/parser/analyze.c | 9 +++++++++
src/backend/rewrite/rewriteHandler.c | 6 ++++++
src/backend/tcop/postgres.c | 3 +++
src/include/nodes/parsenodes.h | 2 ++
src/include/nodes/plannodes.h | 2 ++
src/include/parser/analyze.h | 5 +++++
11 files changed, 34 insertions(+), 0 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2012-03-27 19:19:51 pgsql: Expose track_iotiming information via pg_stat_statements.
Previous Message Robert Haas 2012-03-27 18:56:39 pgsql: New GUC, track_iotiming, to track I/O timings.