0
点赞
收藏
分享

微信扫一扫

click house索引

小飞侠熙熙 2022-05-03 阅读 61

稀疏索引

在这里插入图片描述

语句级多线程

创建二级索引

用法:

	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

查看一个表是否为二级索引表

1sql语句:show CREATE TABLE t_order_index2;
2,进入/var/lib/clickhouse/data/default/t_order_index2/20200602_2_2_0查看文件

在这里插入图片描述

举报

相关推荐

0 条评论