StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
9.03k stars 1.82k forks source link

关于前缀索引字符串截断问题 #45692

Open hungrytortoise opened 6 months ago

hungrytortoise commented 6 months ago

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

Real behavior (Required)

实际查看profile 前缀索引过滤掉了只剩一行记录,即user_id 也生效了

StarRocks version (Required)

-3.1.7

hungrytortoise commented 6 months ago

一共:1038808 记录; profile中查看过滤掉 1038807 image

github-actions[bot] commented 3 days ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!