Pg_stat_statements is postgresql an extension module, the main record of SQL run information Use this module must increase this parameter shared_preload_libraries to postgresql.conf, and need to restart the database 1. Installation module download source code, unzip my directory in/home/postgres/postgresql-9.3.2/contrib/pg_stat_statements make && make install in the installed database directory /opt/pgsql9.3.2/share/extension has pg_stat_statements--1.1.sql instructions to install successfully into the database execution create extension pg_stat_statements; 2. Configuration file Add related parameter # postgresql.conf shared_preload_libraries = ' pg_stat_statements '
Pg_stat_statements.max = 10000 Pg_stat_statements.track = ALL 3. Start the database. Note that version 9.3 does not need to add custom_variable_classes = ' pg_stat_statements ' parameters pg_stat_statementscolumns
Pg_stat_statements (9.3)