Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save camelloj/ad6e0799ec001f060b2d5f8f6b9b4869 to your computer and use it in GitHub Desktop.

Select an option

Save camelloj/ad6e0799ec001f060b2d5f8f6b9b4869 to your computer and use it in GitHub Desktop.

Revisions

  1. camelloj created this gist Jul 10, 2017.
    13 changes: 13 additions & 0 deletions postgresql93_add_pg_stat_statements.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    * Install official PostgreSQL contrib package
    $ yum install postgresql93-contrib
    * Create extension
    $ create extension pg_stat_statements;
    * Edit postgresql.conf
    $ vim /var/lib/pgsql/9.3/data/postgresql.conf
    ** add
    shared_preload_libraries = pg_stat_statements (required)
    track_activity_query_size = 2048 (increase maximum length before which queries are truncated)
    pg_stat_statements.track = ALL (track all statements, including those inside stored procedures)
    pg_stat_statements.max = 10000
    * restart postgres
    $ systemctl restart postgresql-9.3