On 02/23/2012 09:35 AM, Alessandro Gagliardi wrote:
I should have been more clear. I virtually never delete or do updates, but I insert a lot. So the table does change quite a bit, but only in one direction. See: http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html The documentation has information like "This parameter can only be set in the postgresql.conf file or on the server command line." that will tell you in advance which settings will fail when you attempt to set them through SQL statements. But autovacuum is pretty smart about not vacuuming tables until reasonably necessary. And beware that autovacuum is also controlling when to analyze a table. Mass inserts are probably changing the characteristics of your table such that it needs to be analyzed to allow the planner to properly optimize your queries. Have you identified that vacuum is actually causing a problem? If not, I'd leave it alone. The system tables have a lot of information on table vacuuming and analyzing: select relname, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze, vacuum_count, autovacuum_count, analyze_count, autoanalyze_count from pg_stat_user_tables; Cheers, Steve |