Re: sorting problem

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: sorting problem
Дата
Msg-id 87u0qkirv9.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: sorting problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: sorting problem
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > Bruno Wolff III <bruno@wolff.to> writes:
> >> Using an index to do an order by is an order N operation.
>
> > No, using an index to do an order by is actually still n*log(n). You have to
> > traverse all the parent pages in the binary tree of the index as well.
>
> Only if you searched afresh from the root for each key, which an
> indexscan is not going to do.

Isn't that still nlog(n)? In the end you're going to have read in every page
of the index including all those non-leaf pages. Aren't there nlog(n) pages?

--
greg

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

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: sorting problem
Следующее
От: Jerry LeVan
Дата:
Сообщение: OSX 10.3.7 broke Postgresql 8.0.0b5?