implemented code that uses the optimized where formula.

One of the motivation of this feature is to make the following
test pass, which is based on the statement ZABBIX actually uses.
- test_selectTriggerChanged()
The calculation time of the above function is more than one hour.
(we actually don't know how much it takes). However, the statement
includes 1=0 in the where section. And the result is clearly empty.

The implementation of the optimization has not been full. But we
will work though other development items, because the serious
problem fixed.