Better :where_constraint handling