我已经将存储在 S3 中的数据以这样的配置单元格式进行了分区。
bucket/year=2017/month=3/date=1/filename.json
bucket/year=2017/month=3/date=2/filename1.json
bucket/year=2017/month=3/date=3/filename2.json
每个分区有大约 1,000,000 条记录。为此,我在 Athena 中创建了表和分区。
现在从 Athena 运行查询
select count(*) from mts_data_1 where year='2017' and month='3' and date='1'
此查询需要 1800 秒来扫描 1,000,000 条记录。
所以我的问题是如何提高这个查询性能?