Re: heap vacuum & cleanup locks

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-11-09T22:20:56Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Make VACUUM avoid waiting for a cleanup lock, where possible.

Simon Riggs <simon@2ndQuadrant.com> writes:
> heapgetpage() gets a page and a pin, but holds the pin until it reads
> the next page. Wow!

> That is both annoying and very dumb. It should hold the pin long
> enough to copy the data and then release the pin.

I don't find that anywhere near as obvious as you seem to.  I think you
are trying to optimize for the wrong set of conditions.

I will also note that the behavior of holding pin for as long as we are
stopped on a particular tuple is not specific to seqscans.

			regards, tom lane