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

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: Help with unpredictable use of indexes on large tables...
Дата
Msg-id 03e9355ec9b2b3208aa3a79384498a45@mitre.org
обсуждение исходный текст
Ответ на Re: Help with unpredictable use of indexes on large tables...  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Help with unpredictable use of indexes on large tables...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Jessica M Salmon
Дата:
Сообщение: file I/O in plpgsql
Следующее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: configure: error