SORT and Merge Join via Index

Поиск
Список
Период
Сортировка
От Robert James
Тема SORT and Merge Join via Index
Дата
Msg-id CAGYyBgjgmLnRRjUpFOh2OrZJqUqnPpQ-ia673LJwdmy2N0B7Sw@mail.gmail.com
обсуждение исходный текст
Ответы Re: SORT and Merge Join via Index  (Robert James <srobertjames@gmail.com>)
Re: SORT and Merge Join via Index  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-general
I noticed that when I have an index on (a,b) of table t, and I do an
SELECT * FROM t ORDER BY a ASC, it doesn't use the index.  When I
create a new index of only a, it does use the index.  Why is that?

And, more importantly, when I do a query involving a merge join of
table t, which requires sorting table t, the planner does the sort
manually using quicksort, not using the index. The time that step
takes is identical to the ORDER BY without using the index.  What do I
need to do to have Postgres use the index for the merge join?

(Postgres 8.3)

Thanks!


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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: Performance of ORDER BY RANDOM to select random rows?
Следующее
От: Robert James
Дата:
Сообщение: Re: SORT and Merge Join via Index