X-Original-To: pgsql-patches-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 94FDB9FB2CA; Mon, 4 Sep 2006 19:01:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 92899-04; Mon, 4 Sep 2006 22:01:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from localhost.localdomain (host86-130-26-100.range86-130.btcentralplus.com [86.130.26.100]) by postgresql.org (Postfix) with ESMTP id C90CA9FB2C9; Mon, 4 Sep 2006 19:01:36 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by localhost.localdomain with esmtp (Exim 4.62) (envelope-from ) id 1GKMVY-0001tf-D9; Mon, 04 Sep 2006 23:01:32 +0100 To: Bruce Momjian Cc: Tom Lane , pgsql-hackers@postgresql.org, pgsql-patches@postgresql.org Subject: Re: [HACKERS] Trivial patch to double vacuum speed on tables with no indexes In-Reply-To: <200609042147.k84Ll3P04850@momjian.us> (Bruce Momjian's message of "Mon, 4 Sep 2006 17:47:02 -0400 (EDT)") X-Draft-From: ("nnimap+webmail.enterprisedb.com:Inbox" 1568) References: <200609042147.k84Ll3P04850@momjian.us> From: Gregory Stark Organization: EnterpriseDB Date: Mon, 04 Sep 2006 23:01:32 +0100 Message-ID: <87bqpvi94z.fsf@stark.enterprisedb.com> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.127 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: **** X-Archive-Number: 200609/102 X-Sequence-Number: 21115 Bruce Momjian writes: > Tom Lane wrote: >> Bruce Momjian 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