Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group