稀疏索引
语句级多线程
创建二级索引
用法:
create table t_order_mt2(
uid UInt32,
sku_id String,
total_amount Decimal(16,2),
create_time Datetime,
INDEX a total_amount TYPE minmax GRANULARITY 3 //跳数索引
) engine =MergeTree
partition by toYYYYMMDD(create_time)
primary key (uid)
order by (uid,sku_id)
字段说明:
ALTER TABLE t_order_mt
ADD INDEX skipIdxAmount total_amount TYPE minmax GRANULARITY 3
查看一个表是否为二级索引表
1,sql语句:show CREATE TABLE t_order_index2;
2,进入/var/lib/clickhouse/data/default/t_order_index2/20200602_2_2_0查看文件