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

Re: bad estimates / non-scanning aggregates

From: Ken Geis <kgeis(at)speakeasy(dot)org>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad estimates / non-scanning aggregates
Date: 2003-08-29 03:00:32
Message-ID: 3F4EC1D0.5010503@speakeasy.org (view raw or flat)
Thread:
Lists: pgsql-performance
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!

> The answers are guarenteed to be correct. See:
> http://developer.postgresql.org/docs/postgres/sql-select.html#SQL-DISTINCT

That's good to know.  Thanks!


Ken



In response to

Responses

pgsql-performance by date

Next:From: Bruno Wolff IIIDate: 2003-08-29 03:01:56
Subject: Re: bad estimates / non-scanning aggregates
Previous:From: Bruno Wolff IIIDate: 2003-08-29 02:51:09
Subject: Re: bad estimates / non-scanning aggregates

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