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