Re: [HACKERS] Teaching query_planner to handle multiple sort orders?

2017-01-07 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> Of course there is one good solution, which is to have query_planner >> take a set of acceptable output sort orders rather than just a >> single one. >> How wild an idea is this? Tom> It's been on my to-do list for years, see e.g. Tom> https://postgr.es/

Re: [HACKERS] Teaching query_planner to handle multiple sort orders?

2017-01-07 Thread Tom Lane
Andrew Gierth writes: > So in the grouping sets patch post, I said: > There is one current weakness which I don't see a good solution for: > the planner code still has to pick a single value for group_pathkeys > before planning the input path. This means that we sometimes can't > choose a minimal

[HACKERS] Teaching query_planner to handle multiple sort orders?

2017-01-07 Thread Andrew Gierth
So in the grouping sets patch post, I said: >> There is one current weakness which I don't see a good solution for: >> the planner code still has to pick a single value for group_pathkeys >> before planning the input path. This means that we sometimes can't >> choose a minimal set of sorts, b