Re: [HACKERS] Trivial patch to double vacuum speed on tables with no indexes - Mailing list pgsql-patches

From Gregory Stark
Subject Re: [HACKERS] Trivial patch to double vacuum speed on tables with no indexes
Date
Msg-id 87bqpvi94z.fsf@stark.enterprisedb.com
Whole thread Raw
In response to Re: [HACKERS] Trivial patch to double vacuum speed  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
Bruce Momjian <bruce@momjian.us> writes:

> Tom Lane wrote:
>> Bruce Momjian <bruce@momjian.us> writes:
>> > Patch applied.  Thanks.
>>
>> Wait a minute.   This patch changes the behavior so that
>> LockBufferForCleanup is applied to *every* heap page, not only the ones
>> where there are removable tuples.  It's not hard to imagine scenarios
>> where that results in severe system-wide performance degradation.
>> Has there been any real-world testing of this idea?
>
> I see the no-index case now:
>
> +               if (nindexes)
> +                       LockBuffer(buf, BUFFER_LOCK_SHARE);
> +               else
> +                       LockBufferForCleanup(buf);
>
> Let's see what Greg says, or revert.

Hm, that's a good point. I could return it to the original method where it
released the share lock and did he LockBufferForCleanup only if necessary. I
thought it was awkward to acquire a lock then release it to acquire a
different lock on the same buffer but it's true that it doesn't always have to
acquire the second lock.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: setseed() doc
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Information schema - finalize key_column_usage