Re: Help with unpredictable use of indexes on large tables...

From: "John D(dot) Burger" <john(at)mitre(dot)org>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help with unpredictable use of indexes on large tables...
Date: 2006-04-29 14:11:15
Message-ID: 03e9355ec9b2b3208aa3a79384498a45@mitre.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:

> Also I'd suggest trying
>
> select year from [table] group by year
>
> which is capable of using a hash aggregation approach; that will likely
> beat either of these plans.

Just out of curiosity, why doesn't the planner consider the same plan
for the OP's original query:

select distinct year from [table]

Aren't these equivalent (except for the order)?

Thanks.

- John Burger

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian G. Pflug 2006-04-29 14:19:24 Re: configure: error
Previous Message Florian G. Pflug 2006-04-29 13:30:40 Re: Alternative for vacuuming queue-like tables