Re: CLUSTER and MVCC

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Csaba Nagy <nagy(at)ecircle-ag(dot)com>, postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CLUSTER and MVCC
Date: 2007-03-22 21:57:38
Message-ID: 200703222157.l2MLvcB21801@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
> > Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
> > > We wouldn't clean up tuples that are visible to a transaction, but if
> > > you have one long-running transaction like pg_dump in a database with
> > > otherwise short transaction, you'll have a lot of tuples that are not
> > > vacuumable because of the long-running process, but are not in fact
> > > visible to any transaction.
> >
> > It sounds to me like you are proposing to remove the middles of update
> > chains, which would break READ-COMMITTED updates initiated by the older
> > transactions. Now admittedly pg_dump isn't going to issue any such
> > updates, but VACUUM doesn't know that.
>
> Since a multi-statement transaction can't change its transaction
> isolation level after its first statement, would adding a boolean to
> PGPROC help VACUUM be more aggressive about removing rows? I am
> thinking something like PGPROC.cannot_be_serializable.

In researching, I found we already do this by updating PGPROC.xid for
every command in non-serialzable transactions:

* GetTransactionSnapshot
* Get the appropriate snapshot for a new query in a transaction.
*
* The SerializableSnapshot is the first one taken in a transaction.
* In serializable mode we just use that one throughout the transaction.
* In read-committed mode, we take a new snapshot each time we are called.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2007-03-22 22:02:15 Re: Hi, i want to contribute...
Previous Message Luke Lonergan 2007-03-22 21:55:26 Re: TOASTing smaller things