Skip site navigation (1) Skip section navigation (2)

Re: Much Ado About COUNT(*)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Much Ado About COUNT(*)
Date: 2005-01-13 05:06:38
Message-ID: 5314.1105592798@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-announcepgsql-hackerspgsql-patches
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> Even if you could track the tuple's committed-good status reliably,
>> that isn't enough under MVCC.

> I mentioned that:

>> (Oh, and you could only update the bit when all active transactions
>> are newer than the creation transaction so we know they should all see
>> it as visible.)

Ah, right, I missed the connection.  Hmm ... that's sort of the inverse
of the "killed tuple" optimization we put in a release or two back,
where an index tuple is marked as definitely dead once it's committed
dead and the deletion is older than all active transactions.  Maybe that
would work.  You'd still have to visit the heap when a tuple is in the
"uncertain" states, but with luck that'd be only a small fraction of the
time.

I'm still concerned about the update costs of maintaining these bits,
but this would at least escape the index-bloat objection.  I think we
still have one free bit in index tuple headers...

			regards, tom lane

In response to

Responses

pgsql-announce by date

Next:From: Bruce MomjianDate: 2005-01-13 05:25:09
Subject: Re: Much Ado About COUNT(*)
Previous:From: Bruce MomjianDate: 2005-01-13 04:57:56
Subject: Re: Much Ado About COUNT(*)

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-01-13 05:25:09
Subject: Re: Much Ado About COUNT(*)
Previous:From: Bruce MomjianDate: 2005-01-13 04:57:56
Subject: Re: Much Ado About COUNT(*)

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-01-13 05:25:09
Subject: Re: Much Ado About COUNT(*)
Previous:From: Bruce MomjianDate: 2005-01-13 04:57:56
Subject: Re: Much Ado About COUNT(*)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group