Re: Suggestion for optimization - Mailing list pgsql-hackers

From Doug McNaught
Subject Re: Suggestion for optimization
Date
Msg-id m3k7rlzzs4.fsf@varsoon.wireboard.com
Whole thread Raw
In response to Re: Suggestion for optimization  ("Dann Corbit" <DCorbit@connx.com>)
List pgsql-hackers
"Dann Corbit" <DCorbit@connx.com> writes:

> How would this work with MVCC?
> >>
> Whenever a commit occurs, the pending inserts are totaled into the sum
> and the pending deletes are subtracted.  It can be a list in memory or
> whatever.  Maybe you are referring to the old (expired) rows begin
> stored until vacuum?  Perhaps I really don't understand your question or
> the issues involved.  Why does MVCC complicate issues?
> <<

Because the row count depends on what transactions have committed when
yours starts.  Also, you will see the count(*) reflecting INSERTs in
your transaction, but others won't until you commit.  So there is no
well-defined concept of cardinality under MVCC--it depends on which
rows are visible to which transactions.

-Doug
-- 
Doug McNaught       Wireboard Industries      http://www.wireboard.com/
     Custom software development, systems and network consulting.     Java PostgreSQL Enhydra Python Zope Perl Apache
LinuxBSD...
 


pgsql-hackers by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Suggestion for optimization
Next
From: "Dann Corbit"
Date:
Subject: Re: Suggestion for optimization