Re: heap vacuum & cleanup locks - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: heap vacuum & cleanup locks
Date
Msg-id CA+U5nMJ-tFgrLnFV0Q24c-4Co58erkPemyvHG_vJcA69CTHbwg@mail.gmail.com
Whole thread Raw
In response to Re: heap vacuum & cleanup locks  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: heap vacuum & cleanup locks
List pgsql-hackers
On Tue, Nov 8, 2011 at 1:50 PM, Robert Haas <robertmhaas@gmail.com> wrote:

> But there's an efficiency argument against doing it that way.  First,
> if we release the pin then we'll have to reacquire the buffer, which
> means taking and releasing a BufMappingLock, the buffer header
> spinlock, and the buffer content lock.  Second, instead of returning a
> pointer to the data in the page, we'll have to copy the data out of
> the buffer before releasing the pin.

The only way I can see this working is to optimise this in the
planner, so that when we have a nested loop within a loop, we avoid
having the row on the outer loop pinned while we perform the inner
loop.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: DatumGetInetP buggy
Next
From: "Dickson S. Guedes"
Date:
Subject: Re: proposal: psql concise mode