Re: heap vacuum & cleanup locks

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: heap vacuum & cleanup locks
Date: 2011-11-09 23:10:52
Message-ID: CA+U5nMLfU5PkkRbf5ZQB1aZMC8iyM2sCU7x-pAEALi6QyDoPpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 9, 2011 at 10:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)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.

ISTM we should optimise to access the cachelines in the buffer once.
Holding a pin and re-accessing the buffer via main memory seems pretty
bad plan to me. Which conditions are being optimised by doing that?

> 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.

Agreed. Bad things may happen in more than one place.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-11-09 23:12:44 Re: MPI programming in postgreSQL backend source code
Previous Message Tom Lane 2011-11-09 23:10:24 Re: const correctness