Re: Postgresql vs. aggregates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jao(at)geophile(dot)com
Cc: Scott Marlowe <smarlowe(at)qwest(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql vs. aggregates
Date: 2004-06-10 05:51:43
Message-ID: 20286.1086846703@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jao(at)geophile(dot)com writes:
> I'd find all this much easier to reason about if I understood how
> the versions of a row are organized and accessed. How does postgresql
> locate the correct version of a row?

It doesn't, particularly. A seqscan will of course visit all the
versions of a row, and an indexscan will visit all the versions
matching the indexscan key-column conditions. It's up to the "time
qualification" tests (tqual.c) to accept only the version that is
visible to your transaction.

There are two or three implementation choices in the btree index
routines that are intended to increase the chances that you'll hit the
version you want sooner rather than later. But they're only heuristics.
The bottom line is that we check all the versions till we find the
right one.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-06-10 06:03:35 Re: pg_dump and schema namespace notes
Previous Message Tom Lane 2004-06-10 05:41:02 Re: tablespaces and schemas