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


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to