Re: sorting problem - Mailing list pgsql-general

From Tom Lane
Subject Re: sorting problem
Date
Msg-id 21540.1103308172@sss.pgh.pa.us
Whole thread Raw
In response to Re: sorting problem  (Greg Stark <gsstark@mit.edu>)
Responses Re: sorting problem
List pgsql-general
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.

            regards, tom lane

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Problem with pl/perl in postgresql 8.0rc1
Next
From: mjmayfield@pepco.com
Date:
Subject: unsubscribe pgsql-general