Re: Why do I have holes in my pages?

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why do I have holes in my pages?
Date: 2012-09-21 18:41:46
Message-ID: CAGnEbogr2QCtB2ggRGOKWtsQkuwFrjV8doD8+7BWnEo-hiAr_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012/9/21 Jeff Janes <jeff(dot)janes(at)gmail(dot)com>

> To start with, it can be as you say where the ctid and its tuple are
> interesting to someone, but not to you. But eventually the tuple is
> not interesting to anyone, and its space can be reused. But the ctid
> is still needed (to inform stragglers that it's corresponding tuple is
> not interesting, and in fact no longer exists, so move on, nothing to
> see). Then eventually even the ctid itself is not needed anymore even
> for that purpose.
>
> At that point the ctid can be re-used, but only if someone actually
> wants a "new" ctid on that page. An ordinary vacuum will not close up
> the gaps on un-used ctids. Only a vaccum full will do that.
>

In the “Routine Vacuuming” section of the documentation I read that:
«The standard form of VACUUM removes dead row versions in tables and
indexes and marks the space available for future reuse.»
and
«In contrast, VACUUM FULL actively compacts tables by writing a complete
new version of the table file with no dead space.»

What I wanted to say in the previous post was exactly this: vacuum will
mark the space (or gap) as free, while no space will be “returned” to the
OS, except if free pages are at the very end of the data file. I haven't
mentioned vacuum full at all.

It seems that this also matches your explanation, correct me if I'm wrong.

--
Victor Y. Yegorov

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2012-09-21 19:01:22 Re: 9.1 vs 8.4 performance
Previous Message Jeff Janes 2012-09-21 18:40:52 Re: 9.1 vs 8.4 performance