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

Converge all SQL-level statistics timing values to float8 milliseconds.

This patch adjusts the core statistics views to match the decision already
taken for pg_stat_statements, that values representing elapsed time should
be represented as float8 and measured in milliseconds.  By using float8,
we are no longer tied to a specific maximum precision of timing data.
(Internally, it's still microseconds, but we could now change that without
needing changes at the SQL level.)

The columns affected are
pg_stat_bgwriter.checkpoint_write_time
pg_stat_bgwriter.checkpoint_sync_time
pg_stat_database.blk_read_time
pg_stat_database.blk_write_time
pg_stat_user_functions.total_time
pg_stat_user_functions.self_time
pg_stat_xact_user_functions.total_time
pg_stat_xact_user_functions.self_time

The first four of these are new in 9.2, so there is no compatibility issue
from changing them.  The others require a release note comment that they
are now double precision (and can show a fractional part) rather than
bigint as before; also their underlying statistics functions now match
the column definitions, instead of returning bigint microseconds.
This commit is contained in:
Tom Lane
2012-04-30 14:02:47 -04:00
parent 26471a51fc
commit 809e7e21af
9 changed files with 80 additions and 78 deletions

View File

@ -665,7 +665,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</row>
<row>
<entry><structfield>checkpoint_write_time</></entry>
<entry><type>bigint</type></entry>
<entry><type>double precision</type></entry>
<entry>
Total amount of time that has been spent in the portion of
checkpoint processing where files are written to disk, in milliseconds
@ -673,7 +673,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</row>
<row>
<entry><structfield>checkpoint_sync_time</></entry>
<entry><type>bigint</type></entry>
<entry><type>double precision</type></entry>
<entry>
Total amount of time that has been spent in the portion of
checkpoint processing where files are synchronized to disk, in
@ -840,13 +840,13 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</row>
<row>
<entry><structfield>blk_read_time</></entry>
<entry><type>bigint</></entry>
<entry><type>double precision</></entry>
<entry>Time spent reading data file blocks by backends in this database,
in milliseconds</entry>
</row>
<row>
<entry><structfield>blk_write_time</></entry>
<entry><type>bigint</></entry>
<entry><type>double precision</></entry>
<entry>Time spent writing data file blocks by backends in this database,
in milliseconds</entry>
</row>
@ -1318,13 +1318,13 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</row>
<row>
<entry><structfield>total_time</></entry>
<entry><type>bigint</></entry>
<entry><type>double precision</></entry>
<entry>Total time spent in this function and all other functions
called by it, in milliseconds</entry>
</row>
<row>
<entry><structfield>self_time</></entry>
<entry><type>bigint</></entry>
<entry><type>double precision</></entry>
<entry>Total time spent in this function itself, not including
other functions called by it, in milliseconds</entry>
</row>
@ -1534,8 +1534,6 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
The functions for per-function statistics take a function OID.
Note that only tables, indexes, and functions in the current database
can be seen with these functions.
It should also be noted that while the views present timing values in
milliseconds, the underlying functions report timings in microseconds.
</para>
<para>