Re: Postgresql vs. aggregates - Mailing list pgsql-general

From Tom Lane
Subject Re: Postgresql vs. aggregates
Date
Msg-id 20286.1086846703@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postgresql vs. aggregates  (jao@geophile.com)
List pgsql-general
jao@geophile.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: tablespaces and schemas
Next
From: Tom Lane
Date:
Subject: Re: pg_dump and schema namespace notes