Re: Vacuum taking an age
От | Guido Neitzer |
---|---|
Тема | Re: Vacuum taking an age |
Дата | |
Msg-id | BF47E794-F83E-4EE0-A087-9877BCEF8608@event-s.net обсуждение исходный текст |
Ответ на | Vacuum taking an age ("Brian Modra" <epailty@googlemail.com>) |
Список | pgsql-admin |
On 03.01.2008, at 05:48, Brian Modra wrote: > I have a pretty "live" table: rows being inserted and updated more > than once 1 per second, though far, far more inserts than updates. Not that busy ;-) > It has not been vacuumed for months. Not good. > Now a vacuum on that table takes hours, and I have not let it complete > because it stays running into our daily busy time... but I've been > told its necessary because the table is slowing down. > > I have begun a cron job which will do a daily analyze, and am thinking > of a weekly vacuum... > Please advise on the best way to keep this table maintained, even if > it means regularly taking the service offline early on Sunday > morning... Two things you can consider: 1. Cluster the table with one of the indexes. This will be really fast, but is not transaction-safe as far as I remember for 8.2.x. 2. Use autovaccum to vacuum / analyze your database all the time. That will keep the size small and the stats up to date. cug -- http://www.event-s.net
В списке pgsql-admin по дате отправления: