Pg_stat_statements is an extension module of postgresql. It mainly records the running information of SQL statements. This module must add shared_preload_libraries to postgresql. conf, and the database needs to be restarted. download the source code of the installation module, decompress 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 there are pg_stat_statements -- 1.1. SQL instructions that the installation is successful go to the database and execute create extension pg_stat_statements; 2. add related parameters in the configuration file # postgresql. conf shared_preload_libraries = 'pg _ stat_statements'
Pg_stat_statements.max = 10000 pg_stat_statements.track = all 3. Start the database. Note that the custom_variable_classes = 'pg _ stat_statements' parameter pg_stat_statementsColumns does not need to be added in version 9.3.
Pg_stat_statements (9.3)