I didn't notice the query count before, but it's about 11 now. The number of queries has been reduced by one less than the number of days in the month.
I was wondering if that three-dimensional array might take up a lot of memory, if there were a large number of events for the month.