Re: count * performance issue

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Matthew <matthew(at)flymine(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: count * performance issue
Date: 2008-03-11 14:01:06
Message-ID: 47D690A2.2090509@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

Matthew wrote:
> On Tue, 11 Mar 2008, Bill Moran wrote:
>
>> In response to "Robins Tharakan" <tharakan(at)gmail(dot)com>:
>>> Sorry, if I am missing something here, but shouldn't something like this
>>> allow us to get a (fast) accurate count ?
>>>
>>> SELECT COUNT(*) from table WHERE indexed_field IS NULL
>>> +
>>> SELECT COUNT(*) from table WHERE indexed_field IS NOT NULL
>>
>> For certain, qualified definitions of "fast", sure.
>
> And certain, qualified definitions of "accurate" as well. Race condition?

You mean in a three-state-logic? null, not null and something different?

;-)

Tino

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Heikki Linnakangas 2008-03-11 14:03:08 Re: [PERFORM] Very slow (2 tuples/second) sequentialscan after bulk insert; speed returns to ~500 tuples/second aftercommit
Previous Message Matthew 2008-03-11 13:57:03 Re: count * performance issue