Skip to main content

Posts

Showing posts with the label Performance

Enable Expensive Query log in PostgreSQL 9.4

1.        Tool : pg_stat_statements a.        Enabling: to enable statement log add following entries to postgresql.conf and restart the database. shared_preload_libraries = 'pg_stat_statements' pg_stat_statements.max = 10000 pg_stat_statements.track = all Login to database as super user and issue following command CREATE extension pg_stat_statements; b.       Monitor: Following SQL statement would show all the latest SQL statements executed on database server.   select * from pg_stat_statements; c.        Space & Recommendation: as value for pg_stat_statements.max is set to 10000, postgres would keep latest 10,000 SQLs and flush older ones. So the table size would remain in control. This could be enabled on production system as it has les performance cost. 2.        Tool : auto_explain a.  ...