Re: [HACKERS] Concurrent VACUUM: first results - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] Concurrent VACUUM: first results
Date
Msg-id 383E2AE8.5C4ADF65@krs.ru
Whole thread Raw
In response to RE: [HACKERS] Concurrent VACUUM: first results  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses RE: [HACKERS] Concurrent VACUUM: first results
List pgsql-hackers
Hiroshi Inoue wrote:
> 
> > Vadim Mikheev <vadim@krs.ru> writes:
> > >>>> * We have to commit our tuple' movings before we'll truncate
> > >>>> * relation, but we shouldn't lose our locks. And so - quick hack:
> >
> > > ... or moved tuples may be lost in the case of DB/OS crash etc
> > >     that may occur after truncation but before commit...
> >
> > I wonder whether there isn't a cleaner way to do this.  What about
> > removing this early commit, and doing everything else the way that
> > VACUUM does it, except that the physical truncate of the relation
> > file happens *after* the commit at the end of vc_vacone?
> >
> 
> I think there exists another reason.
> We couldn't delete index tuples for deleted but not yet committed
> heap tuples.

You're right!
I just don't remember all reasons why I did as it's done -:))

> If we could start another transaction without releasing exclusive
> lock for the target relation,it would be better.

So. What's problem?! Start it! Commit "moving" xid, get new xid and go!

Vadim


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Concurrent VACUUM: first results
Next
From: Michael Meskes
Date:
Subject: Re: [HACKERS] pid file for postmaster?