// on a FOREACH
Set<Integer> required = new TreeSet<Integer>();
for(int i = 0; i < s.size(); ++i) {
// if we know the data source's schema, pick out the columns we need,
// otherwise take the first n
int index = determinedSchema == null ? i : determinedSchema.findField(s.getField(i).uid);
if(index >= 0)
required.add(index);
}
// pass the indices of the fields we need to a pruner, and fire it off