anchor.diff:          false ->
               {eliminate, Acc}
       end;
  -check_where_clause_is_possible_fold(_, _, {'=',{field,FieldName,_},_} = F, Acc) ->
  +check_where_clause_is_possible_fold(_, _, {'=',{field,FieldName,_},{const,EqVal}} = F, Acc) ->
       case find_filter_check(FieldName, Acc) of
           #filtercheck{'=' = F} ->
               %% this filter has been specified twice so remove the second occurence
               {eliminate, Acc};
  +        #filtercheck{'>' = {_,_,{const,GtVal}} = GtF} = Check1 when GtVal < EqVal ->
  +            %% query like `a = 10 AND a > 8` we can eliminate the greater than
  +            %% clause because if a to be 10 it must also be greater than 8
  +            Acc2 = append_to_eliminate_later(GtF, Acc),
  +            Check2 = Check1#filtercheck{'>' = undefined, '=' = F},
  +            {F, lists:keystore(FieldName, #filtercheck.name, Acc2, Check2)};
           #filtercheck{'=' = F_x} when F_x /= undefined ->
               %% there are two different checks on the same column, for equality
               %% this can never be satisfied.
  
positive.code:         compile(DDL, Q)
      ).
  
  -endif.
  
negative.code:         #filtercheck{'=' = {_,_,{const,EqVal}}} when GtVal >= EqVal ->
              %% query like `a = 10 AND a > 10` cannot be satisfied
              throw({error, {impossible_where_clause, << >>}});
          #filtercheck{'=' = {_,_,{const,EqVal}}} when GtVal < EqVal ->
              %% query like `a = 10 AND a > 8` we can eliminate the greater than
              %% clause because if a to be 10 it must also be greater than 8
              {eliminate, Acc};
          #filtercheck{'>' = undefined} = Check1 ->
              %% this is the first equality check so just record it
              Check2 = Check1#filtercheck{'>' = F},
  