optimizing single table aggregate queries with no index