起因
在做标签引擎的时候,我们在采用了bitmap存储对象id,基础的结构如下
| 标签类型 | 标签值 | 对象id bitmap | 
|---|---|---|
| 性别 | 男 | [1,2,3] | 
| 性别 | 女 | [8,9,10] | 
表如下:
create table if not exists label_string_local on cluster clickhouse_cluster
(
    label_type  String comment '标签id',
    label_value String comment '标签值',
    object_bitmap AggregateFunction(groupBitmap, UInt32) comment '标签值'
)
    engine = AggregatingMergeTree PARTITION BY label_type
        ORDER BY (label_type, label_value)
        SETTINGS index_granularity = 8192;2023/4/7大约 2 分钟
