isempty() IS_NOT_IN_DB() speedup

removed unnecessary ordering