On Tue, Jan 6, 2015 at 12:30 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote:
> > > On Tue, Jan 6, 2015 at 12:23 PM, Atri Sharma <atri.j...@gmail.com> wrote: > >> >>>> >>>> >>>> Even checking whether the output of the function is in the right order > or not, has its cost. I am suggesting that we can eliminate this cost as > well. For example, PostgreSQL does not check whether a function is really > immutable or not. > > That implies possibly returning a non ordered result set even when the user explicitly specified an ORDER BY clause. If we are depending on an optimization and it did not work out (even if it is a user error), I think we should error out indicating that the order was incorrect rather than returning non ordered rows, which could be disastrous IMO.