anchor.diff:  append_to_eliminate_later(Filter, Acc) ->
       ElimLater = proplists:get_value(eliminate_later, Acc),
       lists:keystore(eliminate_later, 1, Acc, {eliminate_later, [Filter|ElimLater]}).
  +
  +store_filter_check(#filtercheck{name = FieldName} = Check, Acc) ->
  +    lists:keystore(FieldName, #filtercheck.name, Acc, Check).
   
   %% TODO put this in the table helper module
   is_field_nullable(FieldName, ?DDL{fields = Fields}) when is_binary(FieldName)->
  
positive.code:             %% 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},
  
negative.code:         #filtercheck{'=' = {_,_,{const,EqVal}}} when GteVal > EqVal ->
              %% query like `a = 10 AND a >= 11` cannot be satisfied
              throw({error, {impossible_where_clause, << >>}});
          #filtercheck{'>' = {_,_,{const,GtVal}} = F_x} = Check1 when GtVal >= GteVal ->
              %% we already have a filter that is higher than the second one,
              %% which we can eliminate. Store it and eliminate it on the second
              %% pass since it has already been iterated
              Check2 = Check1#filtercheck{'>=' = F},
              Acc2 = store_filter_check(Check2, Acc),
              Acc3 = append_to_eliminate_later(F_x, Acc2),
              {F, Acc3};
          #filtercheck{'>=' = undefined} = Check1 ->
              %% this is the first equality check so just record it
              {F, store_filter_check(Check1#filtercheck{'>=' = F}, Acc)};
          #filtercheck{'>=' = F} ->
              %% this filter has been specified twice so remove the second occurence
              {eliminate, Acc};
  