commit
1d7eee9571
21
README.md
21
README.md
|
@ -1,9 +1,9 @@
|
|||
|
||||
### pg_stat_monitor - Statistics collector for [PostgreSQL][1].
|
||||
|
||||
The pg_stat_monitor is statistics collector tool based on PostgreSQL's pg_stat_statement. PostgreSQL’s “pg_stat_statment” provides the basic statistics which is sometimes not enough. The major flaw in this that it accumulates all the queries and its statistics and does not provide aggregate statistics, in that case, the user needs to calculate the aggregate which is quite expensive.
|
||||
The pg_stat_monitor is statistics collector tool based on PostgreSQL's contrib module "pg_stat_statements". PostgreSQL’s “pg_stat_statments” provides the basic statistics which is sometimes not enough. The major shortcoming in pg_stat_statment is that it accumulates all the queries and its statistics and does not provide aggregate statistics or histogram information. in that case, the user needs to calculate the aggregate which is quite expensive.
|
||||
|
||||
Pg_stat_monitor is build on top of pg_stat_statment, so it provides all the pg_stat_statment plus its own feature set.
|
||||
pg_stat_monitor is developed on the basis of pg_stat_statments as more advanced replacement for pg_stat_statment. It provides all the features of pg_stat_statment plus its own feature set.
|
||||
|
||||
#### Supported PostgreSQL Versions.
|
||||
Pg_stat_monitor should work on the latest version of PostgreSQL but only tested with these versions of PostgreSQL.
|
||||
|
@ -26,17 +26,22 @@ or it can be downloaded using the git:
|
|||
|
||||
After downloading the code, set the path for the [PostgreSQL][1] binary:
|
||||
|
||||
###### Compile
|
||||
###### Compile and Install extension
|
||||
cd pg_stat_monitor
|
||||
make USE_PGXS=1
|
||||
make USE_PGXS=1 install
|
||||
|
||||
###### Enable Extension
|
||||
###### Enable and Create Extension
|
||||
|
||||
This extension needs to be loaded at the start time. Which requires adding the pg_stat_monitor extension shared_preload_libraries and restart the PostgreSQL Instance.
|
||||
|
||||
postgres=# alter system set shared_preload_libraries=pg_stat_monitor;
|
||||
ALTER SYSTEM
|
||||
|
||||
sudo systemctl restart postgresql-11
|
||||
|
||||
Create the extension in the desired database.
|
||||
|
||||
postgres=# create extension pg_stat_monitor;
|
||||
CREATE EXTENSION
|
||||
|
||||
|
@ -44,10 +49,10 @@ After downloading the code, set the path for the [PostgreSQL][1] binary:
|
|||
#### Usage
|
||||
There are four views, and complete statistics can be accessed using these views.
|
||||
|
||||
Pg_stat_monitor
|
||||
Pg_stat_agg_database
|
||||
Pg_stat_agg_user
|
||||
pg_stat_agg_hots
|
||||
* pg_stat_monitor
|
||||
* pg_stat_agg_database
|
||||
* pg_stat_agg_user
|
||||
* pg_stat_agg_host
|
||||
|
||||
##### pg_stat_monitor
|
||||
This is the main view which stores per query-based statistics, similar to pg_stat_statment with some additional columns.
|
||||
|
|
Loading…
Reference in New Issue