Re: [HACKERS] Autovacuum Improvements

From: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
To: Darcy Buskermolen <darcyb(at)commandprompt(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>, Pavan Deolasee <pavan(at)enterprisedb(dot)com>, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Autovacuum Improvements
Date: 2007-01-19 22:41:33
Message-ID: 45B1491D.30204@pws.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Darcy Buskermolen wrote:
> [snip]
>
> Another thought, is it at all possible to do a partial vacuum? ie spend the
> next 30 minutes vacuuming foo table, and update the fsm with what hew have
> learned over the 30 mins, even if we have not done a full table scan ?
>
There was a proposal for this, but it was dropped on 2 grounds.
1. partial vacuum would mean that parts of the table are missed, the
user could never vacuum certain parts and transaction wraparound would
get you. You may also have other performance issues as you forgot
certian parts of the table

2. Index cleanup is the most expensive part of vacuum. So doing a
partial vacuum actually means more I/O as you have to do index cleanup
more often.

If we are talking about autovacuum, 1 doesn't become so much of an issue
as you just make the autovacuum remember what parts of the table it's
vacuumed. This really has great power when you have a dead space map.

Item 2 will still be an issue. But if you define "partial" as either
fill maintenance_work_mem, or finish the table, you are not increasing
I/O at all. As when maintenance work mem is full, you have to cleanup
all the indexes anyway. This is really more like VACUUM SINGLE, but the
same principal applies.

I believe all planning really needs to think about how a dead space map
will effect what vacuum is going to be doing in the future.

Strange idea that I haven't researched, Given Vacuum can't be run in a
transaction, it is possible at a certain point to quit the current
transaction and start another one. There has been much chat and now a
TODO item about allowing multiple vacuums to not starve small tables.
But if a big table has a long running vacuum the vacuum of the small
table won't be effective anyway will it? If vacuum of a big table was
done in multiple transactions you could reduce the effect of long
running vacuum. I'm not sure how this effects the rest of the system
thought.

Russell Smith
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-01-19 22:57:42 Re: Multiple column index usage question
Previous Message Jan Muszynski 2007-01-19 21:53:50 Multiple column index usage question

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2007-01-20 01:01:56 pg_dump pretty_print
Previous Message Gavin Sherry 2007-01-19 22:34:45 Re: Planning aggregates which require sorted or distinct