Debug printouts are added at two locations:
* Inside `get_foreign_upper_paths` a notice with the existing paths is
send back together with the stage if the `show_upper` is set to show
the stage.
* Inside `set_rel_pathlist` a notice is printed with the existing paths
if the `show_rel` debug flag is set.
The debug printouts are sent back to the client as debug messages
(`DEBUG2`), allowing developers to quickly experiment and interactively
see what effect different statements has with the respect to the paths
generated.
In addition, the handling of `debug_optimizer_flag` was not correct and
is fixed here.
* If no `=` was provided to `show_upper`, it triggered a segmentation
fault.
* If the flag was reset, the internal data structure was not updated.
* If just one flag was updated in a `SET` command, the other flag was
kept intact.
Add a new `debug_optimizer_flags` option where you can request
optimization debug notices. With this commit, the flags `show_upper`
and `show_rel` are added.
The flag `show_upper` will permit sending back a message with the
resulting relation after creating upper paths. Since this is called at
different stages, the flag support setting specific stages where
printouts should be done using the format `show_upper=window,final`.
The flag `show_rel` will permit sending back the resulting relation
after executing `set_rel_pathlist` to add new paths for consideration.
The actual implementation to sent the notices will be in a separate
commit.