vacuum does not reclaim rows - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject vacuum does not reclaim rows
Date
Msg-id 20030706.000039.78704633.t-ishii@sra.co.jp
Whole thread Raw
Responses Re: vacuum does not reclaim rows  (Kurt Roeckx <Q@ping.be>)
Re: vacuum does not reclaim rows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

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?

Here is an example:

T1: psql db1
T2: psql db2
T3: psql db2

T2: create table t1(i int); insert into t1 values(1);
T1: begin;
T2: delete from t1;
T3: vacuum full t1;

here vacuum will not reclaim deleted rows.

While tracking this, I found that GetOldestXmin(false) checks the
database id correctly:
 if (allDbs || proc->databaseId == MyDatabaseId)

but after that it checks proc->xmin, where xmin may not be running on
the same database. I wonder if this is correct or not. Maybe we should
make sure that xmin is running on the same database if GetOldestXmin()
is called with its arg being set false? This is PostgreSQL 7.3.3.
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: How to submit Tsearch V2 ?
Next
From: Kurt Roeckx
Date:
Subject: Re: vacuum does not reclaim rows