Re: bad estimates

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: Ken Geis <kgeis(at)speakeasy(dot)org>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: bad estimates
Date: 2003-08-29 12:52:34
Message-ID: Pine.BSF.4.44.0308290850190.5324-100000@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 29 Aug 2003, Ken Geis wrote:

> Some good news here. Doing the same as above on 7.4beta2 took 29
> minutes. Now, the 7.3.3 was on reiser and 7.4 on ext2, so take that as
> you will. 7.4's index selectivity estimate seems much better; 7.3.3's
> anticipated rows was ten times the actual; 7.4's is one half of the actual.
>
Min() & Max() unfortunatly suck on PG. It will be that way for a while
perhaps at some point someone will make a "special" case and convince
-HACKERS it is a Good Thing(tm) (Like select count(*) from table being
'cached' - a lot of people probably get bad first impressions because of
that)

Would it be possible ot rewrite your queries replacing min/max with a
select stock_id from bigtable where blah = blorch order by stock_id
(desc|asc) limit 1? because that would enable PG to use an index and
magically "go fast". You may need a subselect..

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Oliver Siegmar 2003-08-29 13:54:46 PL/pgSQL functions - text / varchar - havy performance issue?!
Previous Message Fabian Kreitner 2003-08-29 12:52:10 Force table to be permanently in cache?