-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend the index parameters to support the float type (#74)
- Loading branch information
Showing
10 changed files
with
1,185 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX my_index(f0) TYPE minmax GRANULARITY 1024; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE IF NOT EXISTS test_local | ||
( | ||
`id` UInt64 CODEC(Delta, ZSTD(1)), | ||
`api_id` UInt64 CODEC(ZSTD(1)), | ||
`arr` Array(Int64), | ||
`content` String CODEC(ZSTD(1)), | ||
`output` String, | ||
INDEX id_idx id TYPE minmax GRANULARITY 10, | ||
INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, | ||
INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, | ||
INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1, | ||
INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2 | ||
) | ||
ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') | ||
PARTITION BY toStartOfHour(`timestamp`) | ||
ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`) | ||
TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY,toStartOfHour(`timestamp`) + INTERVAL 2 DAY | ||
SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
-- Origin SQL: | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX my_index(f0) TYPE minmax GRANULARITY 1024; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1; | ||
ALTER TABLE test.events_local ON CLUSTER 'default_cluster' ADD INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2; | ||
|
||
|
||
-- Format SQL: | ||
ALTER TABLE test.events_local | ||
ON CLUSTER 'default_cluster' | ||
ADD INDEX my_index(f0) TYPE minmax GRANULARITY 1024; | ||
ALTER TABLE test.events_local | ||
ON CLUSTER 'default_cluster' | ||
ADD INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2; | ||
ALTER TABLE test.events_local | ||
ON CLUSTER 'default_cluster' | ||
ADD INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3; | ||
ALTER TABLE test.events_local | ||
ON CLUSTER 'default_cluster' | ||
ADD INDEX content_idx content TYPE tokenbf_v1(30720,2,0) GRANULARITY 1; | ||
ALTER TABLE test.events_local | ||
ON CLUSTER 'default_cluster' | ||
ADD INDEX output_idx output TYPE ngrambf_v1(3,10000,2,1) GRANULARITY 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- Origin SQL: | ||
CREATE TABLE IF NOT EXISTS test_local | ||
( | ||
`id` UInt64 CODEC(Delta, ZSTD(1)), | ||
`api_id` UInt64 CODEC(ZSTD(1)), | ||
`arr` Array(Int64), | ||
`content` String CODEC(ZSTD(1)), | ||
`output` String, | ||
INDEX id_idx id TYPE minmax GRANULARITY 10, | ||
INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, | ||
INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, | ||
INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1, | ||
INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2 | ||
) | ||
ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') | ||
PARTITION BY toStartOfHour(`timestamp`) | ||
ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`) | ||
TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY,toStartOfHour(`timestamp`) + INTERVAL 2 DAY | ||
SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1; | ||
|
||
|
||
-- Format SQL: | ||
CREATE TABLE IF NOT EXISTS test_local | ||
( | ||
`id` UInt64 CODEC(Delta, ZSTD(1)), | ||
`api_id` UInt64 CODEC(ZSTD(1)), | ||
`arr` Array(Int64), | ||
`content` String CODEC(ZSTD(1)), | ||
`output` String, | ||
INDEX id_idx id TYPE minmax GRANULARITY 10, | ||
INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, | ||
INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, | ||
INDEX content_idx content TYPE tokenbf_v1(30720,2,0) GRANULARITY 1, | ||
INDEX output_idx output TYPE ngrambf_v1(3,10000,2,1) GRANULARITY 2 | ||
) | ||
ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') | ||
PARTITION BY toStartOfHour(`timestamp`) | ||
TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY,toStartOfHour(`timestamp`) + INTERVAL 2 DAY | ||
SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1 | ||
ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`); |
Oops, something went wrong.