From adb1a6e95b2087e44c845edc15c28a87f5ba7ac1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 25 Mar 2005 21:58:00 +0000 Subject: 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. --- doc/src/sgml/perform.sgml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index 2316df99a5c..ff93eaf8315 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1,5 +1,5 @@ @@ -320,16 +320,19 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 < 50 AND t1 - The Total runtime shown by EXPLAIN ANALYZE includes - executor start-up and shut-down time, as well as time spent processing - the result rows. It does not include parsing, rewriting, or planning - time. For a SELECT query, the total run time will normally be just a - little larger than the total time reported for the top-level plan node. - For INSERT, UPDATE, and DELETE commands, the total run time may be - considerably larger, because it includes the time spent processing the - result rows. In these commands, the time for the top plan node - essentially is the time spent computing the new rows and/or locating - the old ones, but it doesn't include the time spent making the changes. + The Total runtime shown by EXPLAIN + ANALYZE includes executor start-up and shut-down time, as well + as time spent processing the result rows. It does not include parsing, + rewriting, or planning time. For a SELECT query, the total + run time will normally be just a little larger than the total time + reported for the top-level plan node. For INSERT, + UPDATE, and DELETE commands, the total run time + may be considerably larger, because it includes the time spent processing + the result rows. In these commands, the time for the top plan node + essentially is the time spent computing the new rows and/or locating the + old ones, but it doesn't include the time spent making the changes. + Time spent firing triggers, if any, is also outside the top plan node, + and is shown separately for each trigger. -- cgit v1.2.3