Re-implement reduce function for updates.
Re-implement reduce function for updates.

We first check if there are attribute nodes and not any other,
then if there are mixed attributes and pnodes
and then if there are no attributes at all.

The same check is done for pnodes alone, or mixed with attributes or
no pnodes at all.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb