You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
startsWith(a, 'a') does not use the index, though functionally identical like 'a%' does. This is confusing.
How to reproduce
create table test_index (a String) Engine = MergeTree PARTITION BY tuple() ORDER BY a;
INSERT INTO test_index (a) values ('a');
select count() from test_index where startsWith(a, 'abc') settings force_primary_key=1;
Received exception from server (version 19.4.3):
Code: 277. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Primary key (a) is not used and setting 'force_primary_key' is set..
Similar query with LIKE:
select count() from test_index where a like 'abc%' settings force_primary_key=1;
Ok.
Expected behaviour
startsWith to use index if possible.
The text was updated successfully, but these errors were encountered:
Describe the bug
startsWith(a, 'a') does not use the index, though functionally identical like 'a%' does. This is confusing.
How to reproduce
Similar query with LIKE:
Expected behaviour
startsWith to use index if possible.
The text was updated successfully, but these errors were encountered: