1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.15 2002/11/11 20:14:03 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.16 2003/03/20 03:34:55 momjian Exp $
3
3
-->
4
4
5
5
<chapter id="monitoring">
@@ -146,12 +146,13 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
146
146
<important>
147
147
<para>
148
148
Since the variables <varname>STATS_COMMAND_STRING</varname>,
149
- <varname>STATS_BLOCK_LEVEL</varname>,
150
- and <varname>STATS_ROW_LEVEL</varname>
151
- default to <literal>false</>, no statistics are actually collected
152
- in the default configuration. You must turn one or more of them on
153
- before you will get useful results from the statistical display
154
- functions.
149
+ <varname>STATS_BLOCK_LEVEL</varname>, and
150
+ <varname>STATS_ROW_LEVEL</varname> default to <literal>false</>,
151
+ very few statistics are collected in the default
152
+ configuration. Enabling one or more of these configuration
153
+ variables will significantly enhance the amount of useful data
154
+ produced by the statistics collector, at the expense of
155
+ additional run-time overhead.
155
156
</para>
156
157
</important>
157
158
@@ -205,11 +206,15 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
205
206
<tbody>
206
207
<row>
207
208
<entry><structname>pg_stat_activity</></entry>
208
- <entry>One row per server process, showing process <acronym>ID</>, database,
209
- user, and current query. The current query column is only available
210
- to superusers; for others it reads as null. (Note that because of
211
- the collector's reporting delay, current query will only be up-to-date
212
- for long-running queries.)</entry>
209
+ <entry>One row per server process, showing process
210
+ <acronym>ID</>, database, user, current query, and the time at
211
+ which the current query began execution. The columns that report
212
+ data on the current query are only available if the
213
+ <varname>STATS_COMMAND_STRING</varname> configuration option has
214
+ been enabled. Furthermore, these columns can only be accessed by
215
+ superusers; to other users, they always appear NULL. (Note that
216
+ because of the collector's reporting delay, current query will
217
+ only be up-to-date for long-running queries.)</entry>
213
218
</row>
214
219
215
220
<row>
@@ -333,10 +338,20 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
333
338
</para>
334
339
335
340
<para>
336
- The <structname>pg_statio_</> views are primarily useful to determine
337
- the effectiveness of the buffer cache. When the number of actual disk
338
- reads is much smaller than the number of buffer hits, then the cache
339
- is satisfying most read requests without invoking a kernel call.
341
+ The <structname>pg_statio_</> views are primarily useful to
342
+ determine the effectiveness of the buffer cache. When the number
343
+ of actual disk reads is much smaller than the number of buffer
344
+ hits, then the cache is satisfying most read requests without
345
+ invoking a kernel call. However, these statistics do not give the
346
+ entire story: due to the way in which <productname>PostgreSQL</>
347
+ handles disk I/O, data that is not in the
348
+ <productname>PostgreSQL</> buffer cache may still reside in the
349
+ kernel's I/O cache, and may therefore still be fetched without
350
+ requiring a physical read. Users interested in obtaining more
351
+ detailed information on <productname>PostgreSQL</> I/O behavior are
352
+ advised to use the <productname>PostgreSQL</> statistics collector
353
+ in combination with operating system utilities that allow insight
354
+ into the kernel's handling of I/O.
340
355
</para>
341
356
342
357
<para>
@@ -401,7 +416,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
401
416
<entry><function>pg_stat_get_db_blocks_hit</function>(<type>oid</type>)</entry>
402
417
<entry><type>bigint</type></entry>
403
418
<entry>
404
- Number of disk block requests found in cache for database
419
+ Number of disk block fetch requests found in cache for database
405
420
</entry>
406
421
</row>
407
422
@@ -478,7 +493,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
478
493
<entry><type>set of integer</type></entry>
479
494
<entry>
480
495
Set of currently active backend IDs (from 1 to N where N is the
481
- number of active backends). See usage example below.
496
+ number of active backends). See usage example below
482
497
</entry>
483
498
</row>
484
499
@@ -518,15 +533,27 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
518
533
<entry><function>pg_stat_get_backend_activity</function>(<type>integer</type>)</entry>
519
534
<entry><type>text</type></entry>
520
535
<entry>
521
- Current query of backend process (NULL if caller is not superuser)
536
+ Current query of backend process (NULL if caller is not
537
+ superuser, or <varname>STATS_COMMAND_STRING</varname> is not enabled)
522
538
</entry>
523
539
</row>
524
540
541
+ <row>
542
+ <entry><function>pg_stat_get_backend_activity_start</function>(<type>integer</type>)</entry>
543
+ <entry><type>text</type></entry>
544
+ <entry>
545
+ The time at which the specified backend's currently executing query was
546
+ initiated (NULL if caller is not superuser, or
547
+ <varname>STATS_COMMAND_STRING</varname> is not enabled)
548
+ </entry>
549
+ </row>
550
+
551
+
525
552
<row>
526
553
<entry><function>pg_stat_reset</function>()</entry>
527
554
<entry><type>boolean</type></entry>
528
555
<entry>
529
- Reset all currently collected statistics.
556
+ Reset all currently collected statistics
530
557
</entry>
531
558
</row>
532
559
</tbody>
@@ -535,7 +562,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
535
562
536
563
<note>
537
564
<para>
538
- Blocks_fetched minus blocks_hit gives the number of kernel
565
+ <literal>blocks_fetched</literal> minus
566
+ <literal>blocks_hit</literal> gives the number of kernel
539
567
<function>read()</> calls issued for the table, index, or
540
568
database; but the actual number of physical reads is usually
541
569
lower due to kernel-level buffering.
0 commit comments