Changed heuristic for finding sql column BAT.
Changed heuristic for finding sql column BAT.

Instead of blindly guessing that the kdifference after bind_dbat is the
thing to look for, now hope that all instructions depending on sql.bind
calls and what they depend on until a kdiff that directly depends on a
kunion identify what's necessary for the sql column BAT.

This fixes a problem with
    SELECT MAX(trip), MIN(trip) FROM mr_vocus.voyages
where there is only a single sql bind (trip), but two columns generated
from the original bound data.  Now the code correctly sees this and
treats it as two separate columns, and hence the MAX and MIN
aggregations are both pushed into the map program.

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