Re: bad estimates - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: bad estimates
Date
Msg-id 20030829042453.GA5931@wolff.to
Whole thread Raw
In response to Re: bad estimates  (Ken Geis <kgeis@speakeasy.org>)
Responses Re: bad estimates
Re: bad estimates
List pgsql-performance
On Thu, Aug 28, 2003 at 21:09:00 -0700,
  Ken Geis <kgeis@speakeasy.org> wrote:
> Bruno Wolff III wrote:
>
> I am positive!  I can send a log if you want, but I won't post it to the
> list.

Can you do a \d on the real table or is that too sensitive?

It still doesn't make sense that you have a primary key that
is a stock and its price. What happens when the stock has the
same price on two different dates? And I doubt that you are looking
for the minimum and maximum dates for which you have price data.
So it is hard to believe that the index for your primary key is the
one you need for your query.

> The arity on the data is roughly 1500 price_dates per stock_id.

Two index scans (one for min values and another for max values)
should be better than one sequential scan under those conditions.

I am calling it quits for tonight, but will check back tomorrow
to see how things turned out.

pgsql-performance by date:

Previous
From: Ken Geis
Date:
Subject: Re: bad estimates
Next
From: "scott.marlowe"
Date:
Subject: Re: opinion on RAID choice