// * just select ID columns - this gives a 5-10x speedup
// * strip prefetches as they blow the iterated result, and are actually not
// needed
SelectQuery clone = select.queryWithParameters(Collections.EMPTY_MAP, true);
clone.clearPrefetches();
// I guess this check is redundant, as custom attributes warrant data rows
if (!select.isFetchingCustomAttributes()) {
for (DbAttribute attribute : rootEntity.getDbEntity().getPrimaryKeys()) {
clone.addCustomDbAttribute(attribute.getName());