First attempt to speedup statistics building, especially with year and month.