索引粒度与数据量之前的关系
发布于 2 个月前 作者 mayday 541 次浏览 来自 优化策略

目前在测试一张100亿的大表,有尝试过将索引粒度调至1w、2w、3w、4w、5w、10w、20w、50w、100w,但是查询速度提升好像不是很明显,耗时都在200s左右,对于索引粒度与数据量之前的关系,有一个比例或者参考值之类的吗?有人了解吗?官网上也没看过有过多的介绍,附上建表语句与查询语句: CREATE TABLE IF NOT EXISTS nc.test_10 ( start_time_ns Int32, end_time Int32, end_time_ns Int32, cdr_id Int64, cdr_result Int16, frontno Int32, sour_ip Int32, dest_ip Int32, opc Int32, dpc Int32, calling_ssn Int16, called_ssn Int16, calling_gt String, called_gt String, sccp_opc Int32, sccp_dpc Int32, operate_code Int16, result Int32, error_code Int32, msisdn String, msisdn_type Int16, imsi String, imei String, tmsi Int64, hlr String, msc String, user_type Int16, ss_list Int64, servicekey1 Int16, servicekey2 Int16, servicekey3 Int16, scp String, resp_delay Int32, session_time Int32, rand_type Int16, udt_count Int16, udts_count Int16, calling_gt_country_id Int32, calling_gt_oper_id Int32, called_gt_country_id Int32, called_gt_oper_id Int32, msc_prov_id Int32, msc_city_id Int32, hlr_prov_id Int32, user_city_id Int32, proc_result Int32, EventDate Date)) ENGINE = ReplicatedMergeTree(’/clickhouse/tables/{shard}/test_10’, ‘{replica}’,EventDate, (EventDate, start_time, imsi, imei, msisdn), 50000) select start_time,imei,imsi,msisdn from test_10_all order by start_time,imei,imsi,msisdn limit 100;

1 回复

对了,机器配置是Intel® Xeon® CPU E5-2620 v2 @ 2.10GHz,2*6core*2超线程,128G,六台机器,但做了高可用,实际查询只有三台机器

回到顶部