counts with query per predicate