Re: Performance of count(*) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance of count(*)
Date
Msg-id 20588.1174588646@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance of count(*)  ("Craig A. James" <cjames@modgraph-usa.com>)
Responses Re: Performance of count(*)  ("Craig A. James" <cjames@modgraph-usa.com>)
List pgsql-performance
"Craig A. James" <cjames@modgraph-usa.com> writes:
> Steve Atkins wrote:
>> As long as you're ordering by some row in the table then you can do that in
>> straight SQL.
>>
>> select a, b, ts from foo where (stuff) and foo > X order by foo limit 10
>>
>> Then, record the last value of foo you read, and plug it in as X the next
>> time around.

> We've been over this before in this forum: It doesn't work as advertised.  Look for postings by me regarding the fact
thatthere is no way to tell the optimizer the cost of executing a function.  There's one, for example, on Oct 18, 2006. 

You mean
http://archives.postgresql.org/pgsql-performance/2006-10/msg00283.php
?  I don't see anything there that bears on Steve's suggestion.
(The complaint is obsolete as of CVS HEAD anyway.)

            regards, tom lane

pgsql-performance by date:

Previous
From: Steve Atkins
Date:
Subject: Re: Performance of count(*)
Next
From: Michael Stone
Date:
Subject: Re: Parallel Vacuum