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 15:29:16
Message-ID: 9210.1105630156@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2005-01-13 18:22:42 Re: Much Ado About COUNT(*)
Previous Message Bruce Momjian 2005-01-13 14:04:46 Re: Much Ado About COUNT(*)

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-01-13 15:50:22 Re: [HACKERS] Much Ado About COUNT(*)
Previous Message Csaba Nagy 2005-01-13 14:48:51 Re: [HACKERS] Much Ado About COUNT(*)

Browse pgsql-patches by date

  From Date Subject
Next Message David Fetter 2005-01-13 17:26:57 Re: Returning multiple cursors from PL/PgSQL
Previous Message Bruce Momjian 2005-01-13 14:04:46 Re: Much Ado About COUNT(*)