What makes this query perform differently?
CriteriaBuilder builder;
CriteriaQuery criteria;
Root root;
criteria.where(builder.anyOtherCondition()); // runs at a reasonable speed
criteria.where(builder.isNull(root.get("name"))); // takes years
It's as though hibernate is fetching all the data in the database.