aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-02-22 20:33:05 -0500
committerRobert Haas <rhaas@postgresql.org>2012-02-22 20:33:05 -0500
commit2254367435fcc4a31cc3b6d8324e33c5c30f265a (patch)
tree484dc972b60dd19f03cf15c30869a1566c576848 /doc/src
parentf74f9a277c37b42c570ce01019f815abbec58ba0 (diff)
downloadpostgresql-2254367435fcc4a31cc3b6d8324e33c5c30f265a.tar.gz
postgresql-2254367435fcc4a31cc3b6d8324e33c5c30f265a.zip
Make EXPLAIN (BUFFERS) track blocks dirtied, as well as those written.
Also expose the new counters through pg_stat_statements. Patch by me. Review by Fujii Masao and Greg Smith.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/pgstatstatements.sgml14
-rw-r--r--doc/src/sgml/ref/explain.sgml12
2 files changed, 23 insertions, 3 deletions
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 5a0230c4286..ab34ca193a4 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -100,6 +100,13 @@
</row>
<row>
+ <entry><structfield>shared_blks_dirtied</structfield></entry>
+ <entry><type>bigint</type></entry>
+ <entry></entry>
+ <entry>Total number of shared blocks dirtied by the statement</entry>
+ </row>
+
+ <row>
<entry><structfield>shared_blks_written</structfield></entry>
<entry><type>bigint</type></entry>
<entry></entry>
@@ -121,6 +128,13 @@
</row>
<row>
+ <entry><structfield>local_blks_dirtied</structfield></entry>
+ <entry><type>bigint</type></entry>
+ <entry></entry>
+ <entry>Total number of local blocks dirtied by the statement</entry>
+ </row>
+
+ <row>
<entry><structfield>local_blks_written</structfield></entry>
<entry><type>bigint</type></entry>
<entry></entry>
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index 419b72cad34..1f35a1d1552 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -155,14 +155,20 @@ ROLLBACK;
<listitem>
<para>
Include information on buffer usage. Specifically, include the number of
- shared blocks hits, reads, and writes, the number of local blocks hits,
- reads, and writes, and the number of temp blocks reads and writes.
- A <quote>hit</> means that a read was avoided because the block was
+ shared blocks hit, read, dirtied, and written, the number of local blocks
+ hit, read, dirtied, and written, and the number of temp blocks read and
+ written.
+ A <emphasis>hit</> means that a read was avoided because the block was
found already in cache when needed.
Shared blocks contain data from regular tables and indexes;
local blocks contain data from temporary tables and indexes;
while temp blocks contain short-term working data used in sorts, hashes,
Materialize plan nodes, and similar cases.
+ The number of blocks <emphasis>dirtied</> indicates the number of
+ previously unmodified blocks that were changed by this query; while the
+ number of blocks <emphasis>written</> indicates the number of
+ previously-dirtied blocks evicted from cache by this backend during
+ query processing.
The number of blocks shown for an
upper-level node includes those used by all its child nodes. In text
format, only non-zero values are printed. This parameter may only be