Optimize stats_by_project report.