-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Friday, April 05, 2002 11:37 AM
To: Doug McNaught
Cc: Dann Corbit; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Suggestion for optimization 

Doug McNaught <doug@wireboard.com> writes:
> "Dann Corbit" <DCorbit@connx.com> writes:
>> It would be nice if total table cardinality could be maintained live.

> How would this work with MVCC?

It wouldn't.  That's why it's not there.  Under MVCC, table cardinality
is in the eye of the beholder...
>>-------------------------
If this is true (even after a commit) then MVCC is a very bad thing.  No
transactions occur, and two people ask the same question yet get
different answers.  Doesn't that scare anyone?  That would mean (among
other things) that Postgresql cannot be used for a data warehouse.

One of the primary facets of a reliable database transaction system is
repeatability.  In fact, if there is no certain cardinality known after
commits, then there are no reliable database operations that can be
trusted.

How many accounts are 90 days overdue?  Bill says 78 and Frank says 82.
Who is right and how can we know?

I have spent months working on Postgresql projects here (at CONNX
Solutions Inc.) and talked management into using an open source
database.  Please tell me I'm not going to look like a bloody idiot in
the near term.
<<-------------------------

Fri, 5 Apr 2002 11:50:07 -0800
"Dann Corbit" <DCorbit@connx.com>
Re: Suggestion for optimization 
"Dann Corbit" <DCorbit@connx.com> writes:

> If this is true (even after a commit) then MVCC is a very bad thing.  No
> transactions occur, and two people ask the same question yet get
> different answers.  Doesn't that scare anyone?  That would mean (among
> other things) that Postgresql cannot be used for a data warehouse.

Have you read the doc chapter about MVCC?  Sounds like you don't
quite understand how it works yet.

-Doug
-- 
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

05 Apr 2002 14:51:32 -0500
Doug McNaught <doug@wireboard.com>
Re: Suggestion for optimization
"Dann Corbit" <DCorbit@connx.com> writes:
> How many accounts are 90 days overdue?  Bill says 78 and Frank says 82.
> Who is right and how can we know?

If Bill and Frank look at exactly the same instant (ie, from read-only
transactions started at the same time), they will get the same answer.
If they are looking from transactions started at different times, or
from transactions that have themselves added/removed rows, they won't
necessarily get the same answer.  That does not make either answer
wrong, just a reflection of the snapshots they are seeing.

			regards, tom lane

Fri, 05 Apr 2002 14:51:41 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Suggestion for optimization 