Re: Free space management within heap page

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Free space management within heap page
Date: 2007-01-23 09:03:11
Message-ID: 2e78013d0701230103y1d587db9q6733adca0ca92ca0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/23/07, Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-01-23 09:13:44 Re: pg_dump pretty_print
Previous Message Magnus Hagander 2007-01-23 08:51:18 Re: [HACKERS] Win32 WEXITSTATUS too