Re: [HACKERS] using a btree index in order by clause?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] using a btree index in order by clause?
Дата
Msg-id 199806171044.GAA18849@candle.pha.pa.us
обсуждение исходный текст
Ответ на using a btree index in order by clause?  (t-ishii@sra.co.jp)
Список pgsql-hackers
>
> Hi,
>
> I'm wondering if we can use btree index to sort the results in a
> certain condition. The idea is, if the order-items in the order by
> clause have a btree index, then why we need to sort them again?
>
> I'm starting to look at the executor code. However this kind of
> "optimization" might be better to be done in the optimizer, I don't
> know.

FYI, often, using an index to sort a tables is SLOWER than loading all the
rows into psort and sorting them, because the index causes random seeks
all over the table.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

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

Предыдущее
От: "Jose' Soares Da Silva"
Дата:
Сообщение: Re: [GENERAL] COALESCE() or NVL()
Следующее
От: infotechsys@pivot.net
Дата:
Сообщение: http://www.postgresql.org/devel-mlists.shtml