Sometimes filters declare expensive expressions first followed by the cheap expressions at the end. Where possible we should optimize these by moving the expressions at the head, forcing their early evaluation (and selectivity):
where my_function(field) AND field != null
// should become
where field != null && my_function(field)
Sometimes filters declare expensive expressions first followed by the cheap expressions at the end. Where possible we should optimize these by moving the expressions at the head, forcing their early evaluation (and selectivity):