summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-10-17 01:14:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-10-17 01:14:26 +0000
commitfe1b5034dd557822b28877bf423828d37c847702 (patch)
tree103540b238a774f63960407fde58e72f115ad8b6
parentfa2356a1acd4fab20c66079747cf856441cc9546 (diff)
Adjust display of actual runtimes in EXPLAIN output to use three fractional
digits, and label it 'ms' not 'msec', for consistency with psql's \timing display. Per recent discussions.
-rw-r--r--doc/src/sgml/perform.sgml10
-rw-r--r--doc/src/sgml/ref/explain.sgml8
-rw-r--r--src/backend/commands/explain.c6
3 files changed, 12 insertions, 12 deletions
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index 2eaab4d0f0d..cdc96ac56bf 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.34 2003/10/10 02:08:42 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.35 2003/10/17 01:14:26 tgl Exp $
-->
<chapter id="performance-tips">
@@ -284,16 +284,16 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 50 AND t1
QUERY PLAN
-------------------------------------------------------------------------------
Nested Loop (cost=0.00..327.02 rows=49 width=296)
- (actual time=1.18..29.82 rows=50 loops=1)
+ (actual time=1.181..29.822 rows=50 loops=1)
-&gt; Index Scan using tenk1_unique1 on tenk1 t1
(cost=0.00..179.33 rows=49 width=148)
- (actual time=0.63..8.91 rows=50 loops=1)
+ (actual time=0.630..8.917 rows=50 loops=1)
Index Cond: (unique1 &lt; 50)
-&gt; Index Scan using tenk2_unique2 on tenk2 t2
(cost=0.00..3.01 rows=1 width=148)
- (actual time=0.29..0.32 rows=1 loops=50)
+ (actual time=0.295..0.324 rows=1 loops=50)
Index Cond: ("outer".unique2 = t2.unique2)
- Total runtime: 31.60 msec
+ Total runtime: 31.604 ms
</screen>
Note that the <quote>actual time</quote> values are in milliseconds of
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index 754863881d0..942dcf7bad8 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/explain.sgml,v 1.30 2003/09/12 00:12:47 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/explain.sgml,v 1.31 2003/10/17 01:14:26 tgl Exp $
PostgreSQL documentation
-->
@@ -210,10 +210,10 @@ EXPLAIN ANALYZE EXECUTE query(100, 200);
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
- HashAggregate (cost=39.53..39.53 rows=1 width=8) (actual time=0.66..0.67 rows=7 loops=1)
- -&gt; Index Scan using test_pkey on test (cost=0.00..32.97 rows=1311 width=8) (actual time=0.05..0.39 rows=99 loops=1)
+ HashAggregate (cost=39.53..39.53 rows=1 width=8) (actual time=0.661..0.672 rows=7 loops=1)
+ -&gt; Index Scan using test_pkey on test (cost=0.00..32.97 rows=1311 width=8) (actual time=0.050..0.395 rows=99 loops=1)
Index Cond: ((id &gt; $1) AND (id &lt; $2))
- Total runtime: 0.85 msec
+ Total runtime: 0.851 ms
(4 rows)
</programlisting>
</para>
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index eb73c91409b..1b34b17585f 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.116 2003/09/25 18:58:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.117 2003/10/17 01:14:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -270,7 +270,7 @@ ExplainOnePlan(QueryDesc *queryDesc, ExplainStmt *stmt,
if (es->printCost)
{
if (stmt->analyze)
- appendStringInfo(str, "Total runtime: %.2f msec\n",
+ appendStringInfo(str, "Total runtime: %.3f ms\n",
1000.0 * totaltime);
do_text_output_multiline(tstate, str->data);
}
@@ -582,7 +582,7 @@ explain_outNode(StringInfo str,
{
double nloops = planstate->instrument->nloops;
- appendStringInfo(str, " (actual time=%.2f..%.2f rows=%.0f loops=%.0f)",
+ appendStringInfo(str, " (actual time=%.3f..%.3f rows=%.0f loops=%.0f)",
1000.0 * planstate->instrument->startup / nloops,
1000.0 * planstate->instrument->total / nloops,
planstate->instrument->ntuples / nloops,