【发布时间】:2017-03-28 11:35:40
【问题描述】:
我已将存储在 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 条记录。
所以我的问题是如何提高查询性能?
【问题讨论】:
-
分区列的定义是什么?
-
PARTITIONED BY(年份字符串、月份字符串、日期字符串)
-
Athena 在该查询中扫描了多少文件和数据字节?
-
它扫描大约 1000k 文件(大约 250MB 数据)。每个文件都有一个 JSON 记录。
标签: amazon-s3 hive amazon-athena