Only when CachedStore is enabled, we would like to make the following optimizations:
1. During CachedStore prewarm, use one sql call to retrieve column stats objects for a db and store it in the cache.
2. Cache some aggregate stats (e.g. aggregate stats for all partitions, which seems to be commonly used) for query compilation speedup.
3. There was a bug in MetaStoreUtils.aggrPartitionStats, which would use an iterator.next w/o checking with iterator.hasNext. This patch refactors some code to fix that.