On Fri, Sep 22, 2017 at 11:09 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> During planning, *every* node has a list of pathkeys associated with
> it which represent the presumed output ordering. You can support
> ordered append paths without changing any data structures at all; it's
> just a matter of putting pathkeys into an AppendPath.
>
I totally agree.
> The reason why MergeAppend has extra stuff in the node (numCols,
> sortColIdx, etc.) is so that it can actually perform the sort at
> runtime. But this feature requires no runtime support -- that's kinda
> the point -- so there's no need for it to carry that information, or
> to add any new nodes.
>
> At least, IIUC.
That's true, but numCols, sortColdIdx etc are also used to display the
sort key in an explain. If an append can return sorted data, it
should also display the sort information, so I think these fields are
still required in an Append node.
If it's ok to only add these fields in an Append node for the explain
part, I'll revert the Append/MergeAppend refactoring and do some other
cleanup as you advised earlier.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers