From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: heap vacuum & cleanup locks |
Date: | 2011-11-08 15:16:17 |
Message-ID: | CA+TgmoaUPCyD4yexOW6NeLRKZuEKgxmj9hofU8BiXFvuuPaZUw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Nov 8, 2011 at 10:08 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Tue, Nov 8, 2011 at 1:50 PM, Robert Haas <robertmhaas(at)gmail(dot)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.
Hmm. I've actually never run into a problem that involved that
particular situation.
In any case, I think the issues are basically the same: keeping the
pin improves performance; dropping it helps VACUUM. Both are
important.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Albe Laurenz | 2011-11-08 15:19:02 | Re: Disable OpenSSL compression |
Previous Message | Dickson S. Guedes | 2011-11-08 15:11:21 | Re: proposal: psql concise mode |