Search Postgresql Archives

Re: order by not working in view ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Gauthier <davegauthierpg@xxxxxxxxx> writes:
> In the copy/paste below, first 2 lines returned by a select on the view,
> why didn't it sort on start_datetime correctly ?

Putting an ORDER BY in a view is a bit dangerous (last I looked,
it wasn't even legal in standard SQL).  Yeah, the view will sort,
but there is nothing compelling the calling query to preserve
the ordering.

EXPLAIN would give you more info, but I'm betting that the IN is being
converted to a semijoin and then done with a non-order-preserving join
method.

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux