PostgreSQL : ajout info pour pg_stat_statements

This commit is contained in:
Romain Dessort 2018-01-26 11:06:29 -05:00
parent 1fab8b8e5c
commit 9473d32df4

View file

@ -912,9 +912,27 @@ Installation :
~~~
### pg_stats_statement
### pg_stat_statements
(TODO)
`pg_stat_statements` est une extension PostgreSQL permettant de collecter des statistiques sur les requêtes reçues.
Installation :
~~~
# apt install postgresql-contrib-9.6
~~~
Activation :
~~~
shared_preload_libraries = 'pg_stat_statements'
~~~
On a maintenant accès à une vue contenant des informations utiles :
~~~
bench=# SELECT query, calls, total_time, rows, 100.0 * shared_blks_hit / nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent FROM pg_stat_statements ORDER BY total_time DESC LIMIT 5;
~~~
## Réplication