Volodymyr Kostyrko <c(dot)kworr(at)gmail(dot)com> writes:
> Maybe I'm missing something but I have found a case when planner is
> unoptimal.
The planner knows next to nothing about optimizing FULL JOIN, and
I would not recommend holding your breath waiting for it to get better
about that, because there's basically no demand for the work that'd
be involved. I'd suggest refactoring this query instead. A nest of
full joins seems like a rather unintuitive way to get the result
anyway ...
regards, tom lane