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

From Craig A. James
Subject Re: Performance of count(*)
Date
Msg-id 4602C921.3070303@modgraph-usa.com
Whole thread Raw
In response to Re: Performance of count(*)  (Steve Atkins <steve@blighty.com>)
Responses Re: Performance of count(*)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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. 

> I think the problem is more that most web developers aren't very good
> at using the database, and tend to fall back on simplistic, wrong,
> approaches
> to displaying the data. There's a lot of monkey-see, monkey-do in web
> UI design too, which doesn't help.

Thanks, I'm sure your thoughtful comments will help me solve my problem.  Somehow. ;-)

Craig

pgsql-performance by date:

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