Open hungrytortoise opened 3 months ago
1、建表语句 CREATE TABLE short_key_test ( user_id string NOT NULL COMMENT "", app varchar(65533) NOT NULL COMMENT "", acct_no varchar(65533) NOT NULL COMMENT "" ) ENGINE = OLAP PRIMARY KEY(user_id,app,acct_no) DISTRIBUTED BY HASH(acct_no) order by (app,user_id).'
short_key_test
user_id
app
acct_no
explain analyze select * from ads.short_key_test where app='ccc' and user_id='123';
按照文档描述,创建前缀索引会被第一个字符串截断。所以生效的只有app的前缀索引
实际查看profile 前缀索引过滤掉了只剩一行记录,即user_id 也生效了
-3.1.7
一共:1038808 记录; profile中查看过滤掉 1038807
Steps to reproduce the behavior (Required)
1、建表语句 CREATE TABLE
short_key_test
(user_id
string NOT NULL COMMENT "",app
varchar(65533) NOT NULL COMMENT "",acct_no
varchar(65533) NOT NULL COMMENT "" ) ENGINE = OLAP PRIMARY KEY(user_id
,app
,acct_no
) DISTRIBUTED BY HASH(acct_no
) order by (app,user_id).'explain analyze select * from ads.short_key_test where app='ccc' and user_id='123';
Expected behavior (Required)
按照文档描述,创建前缀索引会被第一个字符串截断。所以生效的只有app的前缀索引![image](https://github.com/StarRocks/starrocks/assets/25096206/45c3d549-e2ff-4c16-b3e4-6b224d998e4c)
Real behavior (Required)
实际查看profile 前缀索引过滤掉了只剩一行记录,即user_id 也生效了
StarRocks version (Required)
-3.1.7