doris mor表使用倒排索引非key字段依然生效?

Viewed 17

CREATE TABLE YF_YPMXZ0 (
MXZLSH DECIMAL(18, 4) NULL COMMENT 'MXZLSH',
YFBMBH DECIMAL(18, 4) NULL COMMENT 'YFBMBH',
YPRKPC DECIMAL(18, 4) NULL COMMENT 'YPRKPC',
YPCKPC DECIMAL(18, 4) NULL COMMENT 'YPCKPC',
INDEX idx_YPCKPC (YPCKPC) USING INVERTED COMMENT ''
) ENGINE=OLAP
UNIQUE KEY(MXZLSH)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(MXZLSH) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 2",
"is_being_synced" = "false",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);

image.png
doris版本2.0.9的union模型默认应该是mor的,我在建表的时候没有指定"enable_unique_key_merge_on_write" = "true"但是发现profile中RowsInvertedIndexFiltered依然显示有数据,但是官网上说union中只有mow支持倒排索引,当前索引是否生效?

2 Answers

1、不符合预期,应该是2.0.9版本还没禁掉;正常是应该不允许非mow表的非key列创建,如果创建成功使用,可能查出异常结果。
2、建议升级到2.0.15或2.1.6稳定版本

select count(*) from testdb.YF_YPMXZ0 where YPCKPC=2085118