Skip to content

Commit

Permalink
PG-411 Updated the list of primary keys (#225)
Browse files Browse the repository at this point in the history
modified:   docs/USER_GUIDE.md
  • Loading branch information
nastena1606 authored May 10, 2022
1 parent 1557ff3 commit 9da7c8f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,24 @@ Learn more about using histograms from the [usage example](#histogram-1).

### `pg_stat_monitor` view

The statistics gathered by the module are made available via the view named `pg_stat_monitor`. This view contains one row for each distinct combination of metrics and whether it is a top-level statement or not (up to the maximum number of distinct statements that the module can track). For details about available counters, refer to the [`pg_stat_monitor` view reference](https://github.com/percona/pg_stat_monitor/blob/master/docs/REFERENCE.md).
The statistics gathered by the module are made available via the view named `pg_stat_monitor`. This view contains one row for each distinct combination of metrics and whether it is a top-level statement or not (up to the maximum number of distinct statements that the module can track). For details about available counters, refer to the [`pg_stat_monitor` view reference](REFERENCE.md).

The following are the primary keys for pg_stat_monitor:

* `bucket`,
* `userid`,
* `dbid`,
* `client_ip`,
* `application_name`.
* `bucket`
* `userid`
* `datname`
* `queryid`
* `client_ip`
* `planid`
* `application_name`
* `toplevel`.

A new row is created for each key in the `pg_stat_monitor` view.
> **NOTE**: The `toplevel` key is considered starting with PostgreSQL 14 and above. For PostgreSQL 13 and earlier versions, the `toplevel` value is set to 1 by default, and thus, ignored.
`pg_stat_monitor` inherits the metrics available in `pg_stat_statements`, plus provides additional ones. See the [`pg_stat_monitor` vs `pg_stat_statements` comparison](https://github.com/percona/pg_stat_monitor/blob/master/docs/REFERENCE.md) for details.
A new row is created for each key in the `pg_stat_monitor` view.

`pg_stat_monitor` inherits the metrics available in `pg_stat_statements`, plus provides additional ones. See the [`pg_stat_monitor` vs `pg_stat_statements` comparison](COMPARISON.md) for details.

For security reasons, only superusers and members of the `pg_read_all_stats` role are allowed to see the SQL text and `queryid` of queries executed by other users. Other users can see the statistics, however, if the view has been installed in their database.

Expand Down

0 comments on commit 9da7c8f

Please sign in to comment.