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

Re: bad estimates / non-scanning aggregates

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ken Geis <kgeis(at)speakeasy(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad estimates / non-scanning aggregates
Date: 2003-08-29 03:38:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Thu, Aug 28, 2003 at 20:00:32 -0700,
  Ken Geis <kgeis(at)speakeasy(dot)org> wrote:
> Bruno Wolff III wrote:
> >>Not according to the optimizer!  Plus, this is not guaranteed to return 
> >>the correct results.
> >
> >For it to be fast you need an index on (stock_id, price_date) so that
> >you can use an index scan.
> I already said that such an index existed.  In fact, it is the primary 
> key of the table.  And yes, I *am* analyzed!

Your original example didn't actually match that of the table you are showing
examples from. In that example the second half of the primary key was the
date not the end of the day price. If this is the case for the real table,
then that is the reason the distinct on doesn't help.

In response to


pgsql-performance by date

Next:From: Eko PranotoDate: 2003-08-29 03:44:40
Subject: PostgreSQL HDD Grow capacity
Previous:From: Ron JohnsonDate: 2003-08-29 03:20:10
Subject: Re: Replication Ideas

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