Re: ORDER BY costs

From: Carlos Benkendorf <carlosbenkendorf(at)yahoo(dot)com(dot)br>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: ORDER BY costs
Date: 2005-12-22 14:06:20
Message-ID: 20051222140620.81529.qmail@web35501.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I´m not sure but I think the extra runtime of the select statement that has the ORDER BY clause is because the planner decided to sort the result set.

Is the sort really necessary? Why not only scanning the primary key index pages and retrieving the rows like the select without the order by clause?

Aren´t not the rows retrieved from the index in a odered form?

Thanks in advance!

Benkendorf



---------------------------------
Yahoo! doce lar. Faça do Yahoo! sua homepage.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dave Cramer 2005-12-22 14:17:45 Re: effizient query with jdbc
Previous Message Markus Schaber 2005-12-22 13:34:16 Re: MySQL is faster than PgSQL but a large margin in