Quick idea for reducing VACUUM contention

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Quick idea for reducing VACUUM contention
Date: 2007-07-26 16:09:22
Message-ID: 1185466162.5321.9.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Just wanted to record a quick idea in case its useful in the future.

VACUUM reads all blocks in sequence and waits on each one to acquire a
cleanup lock.

If VACUUM is running with vacuum_delay enabled then we might take a
slightly different approach:

Read the heap blocks in sequence, but make a conditional lock for
cleanup on each block. If we don't get it, sleep, then try again when we
wake up. If we fail the second time, just skip the block completely.

As long as we skip no more than 1% of the blocks we should be able to do
a very good job of cleanup, yet with reduced block contention as the
VACUUM proceeds.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2007-07-26 17:02:15 Re: Machine available for community use
Previous Message Simon Riggs 2007-07-26 16:01:09 Why are we waiting? Thoughts on Further Scalability