1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Add query text to auto_explain output.

Still to be done: fix docs and fix regression failures under auto_explain.
This commit is contained in:
Andrew Dunstan
2010-02-16 22:19:59 +00:00
parent 56adf3703c
commit fc5173ad51
3 changed files with 23 additions and 4 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.202 2010/02/16 20:07:13 stark Exp $
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.203 2010/02/16 22:19:59 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@ -487,6 +487,21 @@ ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
NULL, NULL, NULL, es);
}
/*
* ExplainQueryText -
* add a "Query Text" node that contains the actual text of the query
*
* The caller should have set up the options fields of *es, as well as
* initializing the output buffer es->str.
*
*/
void
ExplainQueryText(ExplainState *es, QueryDesc *queryDesc)
{
if (queryDesc->sourceText)
ExplainPropertyText("Query Text", queryDesc->sourceText, es);
}
/*
* report_triggers -
* report execution stats for a single relation's triggers