PG-210 Doc: Updated column names depending on PG version

added a footenote about toplevel being available starting from PG14 only

modified:   docs/COMPARISON.md
	modified:   docs/REFERENCE.md
pull/140/head
Anastasia Alexadrova 2021-11-16 18:15:45 +02:00
parent ac2aaec72f
commit bb7fd54b74
2 changed files with 29 additions and 19 deletions

View File

@ -21,6 +21,7 @@ Note that the column names differ depending on the PostgreSQL version you are ru
bucket_start_time | bucket_start_time | :heavy_check_mark: | :x: bucket_start_time | bucket_start_time | :heavy_check_mark: | :x:
userid | userid | :heavy_check_mark: | :heavy_check_mark: userid | userid | :heavy_check_mark: | :heavy_check_mark:
datname | datname | :heavy_check_mark: | :heavy_check_mark: datname | datname | :heavy_check_mark: | :heavy_check_mark:
toplevel[^1] | | :heavy_check_mark: | :heavy_check_mark:
client_ip | client_ip | :heavy_check_mark:| :x: client_ip | client_ip | :heavy_check_mark:| :x:
queryid | queryid | :heavy_check_mark: | :heavy_check_mark: queryid | queryid | :heavy_check_mark: | :heavy_check_mark:
planid | planid | :heavy_check_mark:| :x: planid | planid | :heavy_check_mark:| :x:
@ -35,16 +36,17 @@ elevel | elevel | :heavy_check_mark: | :x:
sqlcode | sqlcode | :heavy_check_mark: | :x: sqlcode | sqlcode | :heavy_check_mark: | :x:
message | message | :heavy_check_mark: | :x: message | message | :heavy_check_mark: | :x:
plans_calls | plans_calls | :heavy_check_mark: | :heavy_check_mark: plans_calls | plans_calls | :heavy_check_mark: | :heavy_check_mark:
plan_total_time | plan_total_time | :heavy_check_mark: | :heavy_check_mark: total_plan_time | | :heavy_check_mark: | :heavy_check_mark:
plan_min_time | plan_min_time | :heavy_check_mark: | :heavy_check_mark: min_plan_time | | :heavy_check_mark: | :heavy_check_mark:
plan_max_time | plan_max_time | :heavy_check_mark: | :heavy_check_mark: max_plan_time | | :heavy_check_mark: | :heavy_check_mark:
plan_mean_time | plan_mean_time | :heavy_check_mark: | :heavy_check_mark: mean_plan_time | | :heavy_check_mark: | :heavy_check_mark:
stddev_plan_time | | :heavy_check_mark: | :heavy_check_mark:
calls | calls | :heavy_check_mark: | :heavy_check_mark: calls | calls | :heavy_check_mark: | :heavy_check_mark:
total_time | total_time | :heavy_check_mark: | :heavy_check_mark: total_exec_time | total_time | :heavy_check_mark: | :heavy_check_mark:
min_time | min_time | :heavy_check_mark: | :heavy_check_mark: min_exec_time | min_time | :heavy_check_mark: | :heavy_check_mark:
max_time | max_time | :heavy_check_mark: | :heavy_check_mark: max_exec_time | max_time | :heavy_check_mark: | :heavy_check_mark:
mean_time | mean_time | :heavy_check_mark: | :heavy_check_mark: mean_exec_time | mean_time | :heavy_check_mark: | :heavy_check_mark:
stddev_time | stddev_time | :heavy_check_mark: | :heavy_check_mark: stddev_exec_time | stddev_time | :heavy_check_mark: | :heavy_check_mark:
rows_retrieved | rows_retrieved | :heavy_check_mark: | :heavy_check_mark: rows_retrieved | rows_retrieved | :heavy_check_mark: | :heavy_check_mark:
shared_blks_hit | shared_blks_hit | :heavy_check_mark: | :heavy_check_mark: shared_blks_hit | shared_blks_hit | :heavy_check_mark: | :heavy_check_mark:
shared_blks_read | shared_blks_read | :heavy_check_mark: | :heavy_check_mark: shared_blks_read | shared_blks_read | :heavy_check_mark: | :heavy_check_mark:
@ -71,3 +73,8 @@ To learn more about the features in `pg_stat_monitor`, please see the [User guid
Additional reading: [pg_stat_statements](https://www.postgresql.org/docs/current/pgstatstatements.html) Additional reading: [pg_stat_statements](https://www.postgresql.org/docs/current/pgstatstatements.html)
[^1]: Available starting from PostgreSQL 14 and above

View File

@ -6,7 +6,7 @@
postgres=# \d pg_stat_monitor postgres=# \d pg_stat_monitor
``` ```
Depending on the PostgreSQL version, some column names may differ. The following table describes the `pg_stat_monitor` view for PostgreSQL 13 and higher versions. Depending on the PostgreSQL version, some column names may differ. The following table describes the `pg_stat_monitor` view for PostgreSQL 14 and higher versions.
| Column | Type | Description | Column | Type | Description
@ -15,6 +15,7 @@ Depending on the PostgreSQL version, some column names may differ. The following
bucket_start_time | timestamp with time zone | The start time of the bucket| bucket_start_time | timestamp with time zone | The start time of the bucket|
userid | regrole | An ID of the user who run a query | userid | regrole | An ID of the user who run a query |
datname | name | The name of a database where the query was executed datname | name | The name of a database where the query was executed
toplevel | bool | True means that a query was executed as a top-level statement
client_ip | inet | The IP address of a client that run the query client_ip | inet | The IP address of a client that run the query
queryid | text | The internal hash code serving to identify every query in a statement queryid | text | The internal hash code serving to identify every query in a statement
planid | text | An internally generated ID of a query plan planid | text | An internally generated ID of a query plan
@ -29,17 +30,17 @@ elevel | integer | Shows the error level of a que
sqlcode | integer | SQL error code sqlcode | integer | SQL error code
message | text | The error message message | text | The error message
plans_calls | bigint | The number of times the statement was planned plans_calls | bigint | The number of times the statement was planned
plan_total_time | double precision | The total time (in ms) spent on planning the statement total_plan_time | double precision | The total time (in ms) spent on planning the statement
plan_min_time | double precision | Minimum time (in ms) spent on planning the statement min_plan_time | double precision | Minimum time (in ms) spent on planning the statement
plan_max_time | double precision | Maximum time (in ms) spent on planning the statement max_plan_time | double precision | Maximum time (in ms) spent on planning the statement
plan_mean_time | double precision | The mean (average) time (in ms) spent on planning the statement mean_plan_time | double precision | The mean (average) time (in ms) spent on planning the statement
plan_stddev_time | double precision | The standard deviation of time (in ms) spent on planning the statement stddev_plan_time | double precision | The standard deviation of time (in ms) spent on planning the statement
calls | bigint | The number of times a particular query was executed calls | bigint | The number of times a particular query was executed
total_time | double precision | The total time (in ms) spent on executing a query total_exec_time | double precision | The total time (in ms) spent on executing a query
min_time | double precision | The minimum time (in ms) it took to execute a query min_exec_time | double precision | The minimum time (in ms) it took to execute a query
max_time | double precision | The maximum time (in ms) it took to execute a query max_exec_time | double precision | The maximum time (in ms) it took to execute a query
mean_time | double precision | The mean (average) time (in ms) it took to execute a query mean_time | double precision | The mean (average) time (in ms) it took to execute a query
stddev_time | double precision | The standard deviation of time (in ms) spent on executing a query stddev_exec_time | double precision | The standard deviation of time (in ms) spent on executing a query
rows_retrieved | bigint | The number of rows retrieved when executing a query rows_retrieved | bigint | The number of rows retrieved when executing a query
shared_blks_hit | bigint | Shows the total number of shared memory blocks returned from the cache shared_blks_hit | bigint | Shows the total number of shared memory blocks returned from the cache
shared_blks_read | bigint | Shows the total number of shared blocks returned not from the cache shared_blks_read | bigint | Shows the total number of shared blocks returned not from the cache
@ -61,3 +62,5 @@ wal_fpi | bigint | The total number of WAL FPI (Full Pag
wal_bytes | numeric | Total number of bytes used for the WAL generated by the query wal_bytes | numeric | Total number of bytes used for the WAL generated by the query
state_code | bigint | Shows the state code of a query state_code | bigint | Shows the state code of a query
state | text | The state message state | text | The state message