Order by optimisations?

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Order by optimisations?
Date: 2005-07-13 08:08:43
Message-ID: 42D4CC0B.3070805@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-07-13 08:29:53 Re: Vacuum summary?
Previous Message Bruce Momjian 2005-07-13 02:31:00 Re: [PATCHES] thousands comma numeric formatting in psql