pg_systat
display PostgreSQL statistics
SYNOPSIS
pg_systat [option...] [view] [delay]
DESCRIPTION
pg_systat displays various PostgreSQL statistics in a screen-oriented fashion using the curses(3) screen display library.
While pg_systat is running, the screen is divided into different areas. The top line displays the system time. The bottom line of the screen is reserved for user input and error messages. The information displayed in the rest of the screen comprises a view, and is the main interface for displaying different types of PostgreSQL statistics. The dbxact view is the default.
Certain information may be discarded when the screen size is insufficient for display. For example, in an instance with 24 database the dbxact statistics displays only 21 databases on a 24 line terminal.
OPTIONS
-a | Display all lines. |
-B | Raw, non-interactive mode. The default is to exit after two screen updates, with statistics only ever displayed once. Useful for views such as cpu, where initial calculations are useless. |
-b | Raw, non-interactive mode. The default is to exit after one screen update, with statistics displayed every update. |
-C count | Exit after count screen updates. |
-d dbname | Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. If this parameter contains an = sign or starts with a valid URI prefix (postgresql:// or postgres://), it is treated as a conninfo string. |
-h host | Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket. |
-i | Interactive mode. |
-p port | Specifies the TCP port or the local Unix-domain socket file extension on which the server is listening for connections. Defaults to the value of the PGPORT environment variable or, if not set, to the port specified at compile time, usually 5432. |
-s delay | Specifies the screen refresh time interval in seconds. This option is overridden by the final delay argument, if given. The default interval is 5 seconds. |
-U username | Connect to the database as the user username instead of the default. (You must have permission to do so, of course.) |
-w width | Specifies the maximum width of the output in raw, non-interactive mode. |
view: | The view argument expects to be one of: dbtup, or dbxact. These displays can also be requested interactively and are described in full detail below. view may be abbreviated to the minimum unambiguous prefix; for example, "dbx" for "dbxact". |
---|---|
delay: | The delay argument specifies the screen refresh time interval in seconds. This is provided for backwards compatibility, and overrides any interval specified with the -s flag. The default interval is 5 seconds. |
Certain characters cause immediate action by pg_systat. These are:
:: | Move the cursor to the command line and interpret the input line typed as a command. While entering a command the current character erase, word erase, and line kill characters may be used. |
---|---|
o: | Select the next ordering which sorts the rows according to a combination of columns. Available orderings depend on the view. Not all views support orderings. |
p: | Pause pg_systat. |
q: | Quit pg_systat. |
r: | Reverse the selected ordering if supported by the view. |
,: | Print numbers with thousand separators, where applicable. |
^A | (Home): | Jump to the beginning of the current view. |
^B | (right arrow): | |
Select the previous view. | |
^E | (End): | Jump to the end of the current view. |
^F | (left arrow): | |
Select the next view. | |
^G: | Print the name of the current view being shown and the refresh interval. |
^L: | Refresh the screen. |
^N | (down arrow): | |
Scroll current view down by one line. | |
^P | (up arrow): | |
Scroll current view up by one line. | |
^V | (Page Down): | |
Scroll current view down by one page. | |
Alt-V | (Page Up): | |
Scroll current view up by one page. | |
^Z: | Suspend pg_systat. |
The following commands are interpreted by the "global" command interpreter.
help: | Print the names of the available views on the command line. |
---|---|
order: | Print the names of the available orderings on the command line. |
quit: | Quit pg_systat. (This may be abbreviated to q.) |
stop: | Stop refreshing the screen. |
[start] [number]: | |
Start (continue) refreshing the screen. If a second, numeric, argument is provided it is interpreted as a refresh interval (in seconds). Supplying only a number will set the refresh interval to this value. |
view may be abbreviated to the minimum unambiguous prefix. The available views are:
dbblk: | Display database block statistics:
|
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbconfl: |
|
||||||||||||||||||||
dbtup: | Display database tuple statistics:
|
||||||||||||||||||||
dbxact: | Display database transaction statistics:
|
||||||||||||||||||||
index: | Display index statistics:
|
||||||||||||||||||||
indexio: | Display index I/O statistics:
|
||||||||||||||||||||
tableanalyze: | Display table analyze statistics:
|
||||||||||||||||||||
tableioheap: | Display table heap I/O statistics:
|
||||||||||||||||||||
tableioidx: | Display table index I/O statistics:
|
||||||||||||||||||||
tableiotidx: | Display toast table index I/O statistics:
|
||||||||||||||||||||
tableiotoast: | Display toast table I/O statistics:
|
||||||||||||||||||||
tablescan: | Display table and index scan statistics:
|
||||||||||||||||||||
tabletup: | Display table row modification statistics:
|
||||||||||||||||||||
tablevac: | Display table vacuum statistics:
|
SEE ALSO
pg_top(1)
HISTORY
The pg_systat program was adapted from systat.