1、集群情况
3个节点
2、数据量情况
表数据情况 | 分区个数 | 单分区数据情况 | 明细查询耗时 | 聚合查询耗时(上面使用的是聚合查询1,下面使用的是聚合查询2)
1亿, 21.6G | 15 | 6672037, 1.4GB|0.857, 0.411, 0.037|5.456, 5.144, 4.942
66亿, 2.1T | 75 | 238188342, 76.5GB|2.303, 2.511, 0.374|30.303, 26.908,25.574
表数据情况 | 分区个数 | 单分区数据情况 | 明细查询耗时 | 聚合查询耗时(上面的是聚合查询1,下面的是聚合查询2)
1亿, 21.6G | 15 | 6672037, 1.4GB | 0.857, 0.411, 0.037 | 5.456, 5.144, 4.942
66亿, 2.1T | 75 | 238188342, 76.5GB | 2.303, 2.511, 0.374 | 30.303, 26.908,25.574
明细查询
SELECT fexec_date,fexec_hhmm,finterface,fserver_ip,fset,fproduct_name,fcall_num,ferror_num,fcall_time,fmax_call_time,fmin_call_time
FROM test_cratedb_10y
WHERE fexec_date>='2017-03-11' AND fexec_date<='2017-03-11' AND finterface='com.tencent.ieg.clean'
ORDER BY fexec_hhmm
LIMIT 10;
聚合查询1
SELECT fexec_date,fexec_hhmm,finterface,fserver_ip,fproduct_name,COUNT(fcall_num),COUNT(DISTINCT fserver_ip),SUM(ferror_num),AVG(fcall_time),MAX(fmax_call_time),MIN(fmin_call_time)
FROM test_cratedb_10y
WHERE fexec_date='2017-03-11' AND finterface='com.tencent.ieg.clean'
GROUP BY fexec_date,fexec_hhmm,finterface,fserver_ip,fproduct_name
ORDER BY fexec_hhmm
LIMIT 10;
使用聚合查询1,查询大数据量,超时不返回数据。
聚合查询2
SELECT fexec_date,fexec_hhmm,finterface,COUNT(fcall_num),COUNT(DISTINCT fserver_ip),SUM(ferror_num),AVG(fcall_time),MAX(fmax_call_time),MIN(fmin_call_time)
FROM test_cratedb_10y
WHERE fexec_date='2017-03-11' AND finterface='com.tencent.ieg.clean'
GROUP BY fexec_date,fexec_hhmm,finterface
ORDER BY fexec_hhmm
LIMIT 10;