On 9/9/15 7:55 PM, Charles Sheridan wrote:
>> The better question is how expensive is it to sort already sorted
>> data. If its cheap, and it likely is, then placing explicit sorting
>> where you care is the best solution regardless of your level of
>> confidence that lower level sorting is being maintained.
...
> David, yes, I agree that sorting at the end is the highest-confidence
> approach. I don't (yet) have a large stack of views with an assumption
> of a guaranteed underlying sort order, I'm just trying to get a better
> sense of what Postgres behavior I can reasonably expect here.
BTW, I believe there is some code in the planner to remove useless
ORDER-BYs.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com