-
Feature Request
-
Resolution: Done
-
Major
-
0.6
-
None
-
Low
Our search/query implementation will perform much better when it can detect a range of values in a criteria. Currently, ranges can only be specified using the form "WHERE ... <dynamicOperand> <operator1> <staticOperand1> ... AND <dynamicOperand> <operator2> <staticOperand2> ..." For example:
WHERE ... DEPTH(myType) >= 3 AND DEPTH(myType) <=6
SQL already has a BETWEEN operator (and corresponding NOT BETWEEN operator) that makes this not only more concise but also more easily understandable and obvious about the intent:
WHERE ... DEPTH(myType) BETWEEN 3 and 6
This concept would also have to be added to the abstract query model, and in particular as a subclass of Constraint that has a DynamicOperand and two StaticOperand values. And by adding this specialization of Constraint, we can add an optimizer rule that looks for ANDed constraints that represent a range on a DynamicOperand, and rewrite the constraints as a BETWEEN (or NOT BETWEEN).
Note that a NOT BETWEEN would simply wrap a BetweenCriteria with a Not.