1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Track temporary file count and size in pg_stat_database

Add counters for number and size of temporary files used
for spill-to-disk queries for each database to the
pg_stat_database view.

Tomas Vondra, review by Magnus Hagander
This commit is contained in:
Magnus Hagander
2012-01-26 14:41:19 +01:00
parent 9d35116611
commit bc3347484a
9 changed files with 150 additions and 25 deletions

View File

@ -283,7 +283,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
read requests avoided by finding the block already in buffer cache),
number of rows returned, fetched, inserted, updated and deleted, the
total number of queries canceled due to conflict with recovery (on
standby servers), and time of last statistics reset.
standby servers), number and size of temporary files used, and time
of last statistics reset.
</entry>
</row>
@ -886,6 +887,28 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</entry>
</row>
<row>
<entry><literal><function>pg_stat_get_db_temp_bytes</function>(<type>oid</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry>
Amount of data written to temporary files by queries in the database.
All temporary files are counted, regardless of why the temporary file
was created (sorting or hash), and regardless of the
<xref linkend="guc-log-temp-files"> setting.
</entry>
</row>
<row>
<entry><literal><function>pg_stat_get_db_temp_files</function>(<type>oid</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry>
Number of temporary files written by queries in the database. All temporary
files are counted, regardless of why the temporary file was created
(sorting or hash) or file size, and regardless of the
<xref linkend="guc-log-temp-files"> setting.
</entry>
</row>
<row>
<entry><literal><function>pg_stat_get_numscans</function>(<type>oid</type>)</literal></entry>
<entry><type>bigint</type></entry>