I can't figure out why ExecGather/ExecGatherMerge do check whether num_workers
is non-zero. I think the code would be a bit clearer if these tests were
replaced with Assert() statements, as the attached patch does.
In addition, if my assumptions are correct, I think that only Gather node
needs the single_copy field, but GatherPath does not.
In the patch I also added Assert() to add_partial_path so that I'm more likely
to catch special cases. Regression tests passed though.
--
Antonin Houska
Web: https://www.cybertec-postgresql.com