Re: sorting problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: sorting problem
Date: 2004-12-17 18:29:32
Message-ID: 21540.1103308172@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Bruno Wolff III <bruno(at)wolff(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mjmayfield 2004-12-17 18:31:22 unsubscribe pgsql-general
Previous Message David Fetter 2004-12-17 17:56:32 Re: Problem with pl/perl in postgresql 8.0rc1