Re: a few questions (and doubts) about xid - Mailing list pgsql-general

From Luca Ferrari
Subject Re: a few questions (and doubts) about xid
Date
Msg-id 200708011353.43872.fluca1978@infinito.it
Whole thread Raw
In response to Re: a few questions (and doubts) about xid  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
On Wednesday 1 August 2007 Gregory Stark's cat, walking on the keyboard,
wrote:

> You're right, the index contains pointers to *every* version of the tuple.
> So in a regular SELECT statement you don't need to look at the update chain
> at all.
>
> The main use of the update chain is when you want to perform an UPDATE or
> DELETE. In that case when you come across a record which is being updated
> by another transaction you must wait until that other transaction finishes
> and then update the resulting record (if you're in read-committed mode).

So, just to see if I got this, if the HeapTupleSatisfiesUpdate returns
HeapTupleUpdated the chain update must be walked, right?


> > Third, I read about not valid MVCC snapshots (e.g., SnapshotNow). What is
> > the meaning of such "strange" snapshots? Because postgresql should always
> > guarantee at least read committed isolation, and thus this should be done
> > thru MVCC.....
>
> They're needed for things like the above UPDATE chain following

uhm...so first I get a tuple version using HeapSatisfiesUpdate, then if the
tuple is HeapTupleUpdated I follow the update chain, then (may be) recheck
with HeapTupleSatisfiesSnapshot with a SnapshotNow?? Something like this?

Thanks,
Luca




pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: a few questions (and doubts) about xid
Next
From: paolo@ecometer.it
Date:
Subject: Linux distro