Skip site navigation (1) Skip section navigation (2)

Re: Performance of count(*)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
Cc: Steve Atkins <steve(at)blighty(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance of count(*)
Date: 2007-03-22 18:37:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
"Craig A. James" <cjames(at)modgraph-usa(dot)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 that there is no way to tell the optimizer the cost of executing a function.  There's one, for example, on Oct 18, 2006.

You mean
?  I don't see anything there that bears on Steve's suggestion.
(The complaint is obsolete as of CVS HEAD anyway.)

			regards, tom lane

In response to


pgsql-performance by date

Next:From: Michael StoneDate: 2007-03-22 18:46:15
Subject: Re: Parallel Vacuum
Previous:From: Steve AtkinsDate: 2007-03-22 18:37:19
Subject: Re: Performance of count(*)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group