Optimize DBIC query for datasets overview