Re: count * performance issue

From: Matthew <matthew(at)flymine(dot)org>
To:
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: count * performance issue
Date: 2008-03-11 13:57:03
Message-ID: Pine.LNX.4.64.0803111355440.20402@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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?

Matthew

--
"Television is a medium because it is neither rare nor well done."
-- Fred Friendly

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tino Wildenhain 2008-03-11 14:01:06 Re: count * performance issue
Previous Message Dave Cramer 2008-03-11 13:46:08 Re: how many index can have????