Skip to main content

Posts

Showing posts from June, 2019

Performance tuning PostgreSQL(Part-II) - Basic Server Configuration

In part(I)  Performance tuning PostgreSQL - Basic query tuning concepts   , I had written on some basic ideas related to improve query performance. In this post, I have written about some basic postgresql.conf parameters, which we should know while configure server. autovacuum Whenever rows in a PostgreSQL table are updated or deleted, dead rows are left behind. VACUUM gets rid of them so that the space can be reused. If a table doesn’t get vacuumed, it will get bloated, which wastes disk space and slows down sequential table scans (and – to a smaller extent – index scans). VACUUM also takes care of freezing table rows so to avoid problems when the transaction ID counter wraps around. SELECT schemaname, relname, n_live_tup, n_dead_tup, last_autovacuum FROM pg_stat_all_tables ORDER BY n_dead_tup     / (n_live_tup        * current_setting('autovacuum_vacuum_scale_factor')::float8    ...