mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Improve EXPLAIN ANALYZE to show the time spent in each trigger when
executing a statement that fires triggers. Formerly this time was included in "Total runtime" but not otherwise accounted for. As a side benefit, we avoid re-opening relations when firing non-deferred AFTER triggers, because the trigger code can re-use the main executor's ResultRelInfo data structure.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Copyright (c) 2001-2005, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/instrument.c,v 1.10 2005/03/20 22:27:51 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/instrument.c,v 1.11 2005/03/25 21:57:58 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -18,13 +18,13 @@
|
||||
#include "executor/instrument.h"
|
||||
|
||||
|
||||
/* Allocate new instrumentation structure */
|
||||
/* Allocate new instrumentation structure(s) */
|
||||
Instrumentation *
|
||||
InstrAlloc(void)
|
||||
InstrAlloc(int n)
|
||||
{
|
||||
Instrumentation *instr = palloc(sizeof(Instrumentation));
|
||||
Instrumentation *instr = palloc0(n * sizeof(Instrumentation));
|
||||
|
||||
memset(instr, 0, sizeof(Instrumentation));
|
||||
/* we don't need to do any initialization except zero 'em */
|
||||
|
||||
return instr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user