Order by optimisations? - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Order by optimisations?
Date
Msg-id 42D4CC0B.3070805@familyhealth.com.au
Whole thread Raw
Responses Re: Order by optimisations?  (Hannu Krosing <hannu@skype.net>)
List pgsql-hackers
Hi,

Does PostgreSQL do the following optimisation:

SELECT * FROM diary WHERE date = '2005-05-01' ORDER BY date;

or in fact even better (for my situation)

SELECT * FROM diary WHERE date BETWEEN '2005-05-01' AND '2005-05-01' 
ORDER BY date;

Does it know that the input to the sort routine is already sorted and 
hence is a no-op?

Chris



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] thousands comma numeric formatting in psql
Next
From: Simon Riggs
Date:
Subject: Re: Vacuum summary?