Created
September 28, 2018 08:41
-
-
Save blacktrub/96e62d245b3f72c7f73ccb86de51a4bd to your computer and use it in GitHub Desktop.
enable pg_stat_statements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # paste this in your postgresql.conf | |
| # in my way it is in /etc/postgresql/9.5/main/postgresql.conf | |
| shared_preload_libraries = 'pg_stat_statements' | |
| track_activity_query_size = 2048 | |
| pg_stat_statements.track = all | |
| # after this you must restart postgresql daemon | |
| sudo service postgresql restart | |
| # connect to your db with psql and create extension | |
| CREATE EXTENSION pg_stat_statements; | |
| # now you may get all queries | |
| SELECT * FROM pg_stat_statements; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment