<!--
-$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">
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)
-> 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 < 50)
-> 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
<!--
-$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
-->
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
- HashAggregate (cost=39.53..39.53 rows=1 width=8) (actual time=0.66..0.67 rows=7 loops=1)
- -> 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)
+ -> 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 > $1) AND (id < $2))
- Total runtime: 0.85 msec
+ Total runtime: 0.851 ms
(4 rows)
</programlisting>
</para>
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
}
{
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,