Closed
Description
Test Table:
Create table test.test (
partition String
,map_values Map(String, String)
) ENGINE = ReplicatedMergeTree()
PARTITION BY partition
ORDER BY(map_values[‘key’])
SETTINGS index_granularity = 8192
Test query:
select count(*) from test.test where map_values[‘key’] = ‘1’;
ClickHouse client version 21.8.10.19 (official build)
Connected to ClickHouse server version 21.8.10 revision 54449
It seems that the query would not skipped the indexes.
How could I create index for the map type column or one key of the map type column?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
lingtaolf commentedon Dec 9, 2021
Just like below
It only check keys of map .
phhcer commentedon Dec 14, 2021
thx!I will try it.
By the way, where could I find the src code for the skipping index implement of ColumnMap?
phhcer commentedon Dec 14, 2021
Could you tell me the path of the project to find it?
lingtaolf commentedon Dec 15, 2021
@phhcer #28511 & #29220
kitaisreal commentedon Jan 21, 2022
You can create index for map keys, or for map values. Example:
Link to documentation https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree/#available-types-of-indices.