Re: Order by optimisations? - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: Order by optimisations?
Date
Msg-id 42D72110.8010001@familyhealth.com.au
Whole thread Raw
In response to Re: Order by optimisations?  ("Andrew Dunstan" <andrew@dunslane.net>)
List pgsql-hackers
> I assume that this is program generated SQL, as I hope a human would know
> better than to write this. In which case, isn't the answer to improve the
> generator rather than expect postgres to make up for its defficiencies?

Well, the issue in my case is we have user food diaries.  Usually, 
99.9999% of the time we pull up a single date of their diary.  However, 
for printing purposes we need a range.

It's a large query, so it's implemented as a simple PL/PSQL stored 
procedure.

I was trying to avoid having to c&p the entire stored proc to make a 
'range version'.

If PostgreSQL was smart enough to deal with a range of 1 day and a sort 
on it efficiently, I'd just use the range stored proc exclusively....

Chris



pgsql-hackers by date:

Previous
From: "Luke Lonergan"
Date:
Subject: Re: multibyte regression tests
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Order by optimisations?