Re: vacuum does not reclaim rows

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: Q(at)ping(dot)be
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: vacuum does not reclaim rows
Date: 2003-07-05 23:38:18
Message-ID: 20030706.083818.112625481.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Does anybody know why vacuum full does not relcaim deleted rows if a
> > open transaction which started before the deletion happens is running
> > even on a different database?
>
> On what do you base that it doesn't reclaim those rows?

test=# vacuum full verbose t1;
INFO: --Relation public.t1--
INFO: Pages 1: Changed 1, reaped 0, Empty 0, New 0; Tup 1: Vac 0, Keep/VTL 1/0, UnUsed 0, MinLen 32, MaxLen 32; Re-using: Free/Avail. Space 8136/8136; EndEmpty/Avail. Pages 0/1.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: Rel t1: Pages: 1 --> 1; Tuple(s) moved: 0.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM

Here you can see "Pages: 1 --> 1; Tuple(s) moved: 0", it indicates
vacuum actually skips the table and does not reclaim those rows.

Here is a case when vacuum does reclaim.

test=# vacuum full verbose t1;
INFO: --Relation public.t1--
INFO: Pages 1: Changed 0, reaped 1, Empty 0, New 0; Tup 0: Vac 1, Keep/VTL 0/0, UnUsed 0, MinLen 0, MaxLen 0; Re-using: Free/Avail. Space 8168/0; EndEmpty/Avail. Pages 1/0.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: Rel t1: Pages: 1 --> 0.
VACUUM
--
Tatsuo Ishii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hilmar Lapp 2003-07-05 23:40:52 Re: PostgreSQL vs. MySQL
Previous Message Kurt Roeckx 2003-07-05 18:44:50 Re: vacuum does not reclaim rows