Re: Much Ado About COUNT(*) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Much Ado About COUNT(*)
Date
Msg-id 9210.1105630156@sss.pgh.pa.us
Whole thread Raw
In response to Re: Much Ado About COUNT(*)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Much Ado About COUNT(*)  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> The ugly part of this is that clearing the bit is not like setting a
>> hint bit, ie it's not okay if we lose that change.  Therefore, each
>> bit-clearing would have to be WAL-logged.  This is a big part of my
>> concern about the cost.

> Yep, that was my concern too.  My feeling is that once you mark the
> tuple for expiration (update/delete), you then clear the index bit. 
> When reading WAL on recovery, you have to clear index bits on rows as
> you read expire information from WAL.  I don't think it would require
> extra WAL information.

Wrong.  The WAL recovery environment is not capable of executing
arbitrary user-defined functions, therefore it cannot compute index
entries on its own.  The *only* way we can do this is if the WAL record
stream tells exactly what to do and which physical tuple to do it to.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Much Ado About COUNT(*)
Next
From: Bruce Momjian
Date:
Subject: Win32 config file extension, capitalization