Running below, where both b and p are rather complex, but individually each are quite fast, however running UNION ALL is very slow:

This seems to be a well known issue with sql in general, for example:
https://stackoverflow.com/questions/44055834/simple-sql-union-all-very-slow
https://stackoverflow.com/questions/38373206/multiple-union-alls-unbearably-slow
Wonder what would be Vertica's solution? Thanks