>
> 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)