Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 759B99FB1C6 for ; Tue, 23 Jan 2007 05:03:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 42786-01 for ; Tue, 23 Jan 2007 05:03:12 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by postgresql.org (Postfix) with ESMTP id 29B5E9FA617 for ; Tue, 23 Jan 2007 05:03:14 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c24so544166ana for ; Tue, 23 Jan 2007 01:03:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=K552Pk020I1VGUYHsd6VhMlUoPJwOUTih/KuzJ6KBcIsIZgz/lSQqFWbH6LfZsu2slNb7BUq6IJpAkjxiOUCz5uXQMujZXdCmmMP0BSDvgM72cRtt6b6wn+7mRhHE4VNyIscCfLali3WN7Gl4Xzb71jLuyoVVTz6FBxxDfoqhoU= Received: by 10.78.180.16 with SMTP id c16mr201728huf.1169542991991; Tue, 23 Jan 2007 01:03:11 -0800 (PST) Received: by 10.78.81.13 with HTTP; Tue, 23 Jan 2007 01:03:11 -0800 (PST) Message-ID: <2e78013d0701230103y1d587db9q6733adca0ca92ca0@mail.gmail.com> Date: Tue, 23 Jan 2007 14:33:11 +0530 From: "Pavan Deolasee" To: "Martijn van Oosterhout" Subject: Re: Free space management within heap page Cc: pgsql-hackers@postgresql.org In-Reply-To: <20070123084846.GC19527@svana.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_171119_20792111.1169542991910" References: <2e78013d0701230018m7bebdd35t32bdc8ea786511e8@mail.gmail.com> <20070123084846.GC19527@svana.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/1036 X-Sequence-Number: 96937 ------=_Part_171119_20792111.1169542991910 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/23/07, Martijn van Oosterhout wrote: > > On Tue, Jan 23, 2007 at 01:48:08PM +0530, Pavan Deolasee wrote: > > > We might not be able to reuse the line pointers because indexes may have > > references to it. All such line pointers will be freed when the page is > > vacuumed during the regular vacuum. > > The overwhelming vast majoirty of tuples are going to be in one or more > indexes. Which means nearly all tuples are going to fall into this > category. So where's the benefit? The line pointers can not reused, but the space consumed by the tuple can be. So the benefit is in utilizing that space for newer tuples and thus reduce the bloat. One assumption I am making here is that its sufficient to mark the line pointer "unused" (reset LP_USED flag) even though there is an index entry pointing to the tuple. During index scan, we anyways check for ItemIdIsUsed() before proceeding further. I know it might break the ctid chain, but does that really matter ? I don't see any reason why somebody would need to follow ctid chain past a dead tuple. Thanks, Pavan EnterpriseDB http://www.enterprisedb.com ------=_Part_171119_20792111.1169542991910 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 1/23/07, Martijn van Oosterhout <kleptog@svana.org> wrote:
On Tue, Jan 23, 2007 at 01:48:08PM +0530, Pavan Deolasee wrote:

> We might not be able to reuse the line pointers because indexes may have
> references to it. All such line pointers will be freed when the page is
> vacuumed during the regular vacuum.

The overwhelming vast majoirty of tuples are going to be in one or more
indexes. Which means nearly all tuples are going to fall into this
category. So where's the benefit?

The line pointers can not reused, but the space consumed by the tuple can be.
So the benefit is in utilizing that space for newer tuples and thus reduce the
bloat.

One assumption I am  making here is that its sufficient to mark the line pointer
"unused" (reset LP_USED flag) even though there is an index entry pointing to
the tuple. During index scan, we anyways check for ItemIdIsUsed() before
proceeding further. I know it might break the ctid chain, but does that really
matter ? I don't see any reason why somebody would need to follow ctid chain
past a dead tuple.

Thanks,
Pavan

EnterpriseDB     http://www.enterprisedb.com ------=_Part_171119_20792111.1169542991910--