fix for incorrect optimization when order by expression involves
field-values, but is constant relative to the enclosing for clause