Merge pull request #3504 from yandex/merge_big_parts_using_direct_io

Enable merge with DIRECT_IO when summary size of participating parts more than 10GB
This commit is contained in:
alesapin 2018-10-31 18:11:32 +03:00 committed by GitHub
commit 237186056a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -149,7 +149,7 @@ struct MergeTreeSettings
M(SettingUInt64, finished_mutations_to_keep, 100) \
\
/** Minimal amount of bytes to enable O_DIRECT in merge (0 - disabled) */ \
M(SettingUInt64, min_merge_bytes_to_use_direct_io, 0)
M(SettingUInt64, min_merge_bytes_to_use_direct_io, 10ULL * 1024 * 1024 * 1024)
/// Settings that should not change after the creation of a table.
#define APPLY_FOR_IMMUTABLE_MERGE_TREE_SETTINGS(M) \

View File

@ -0,0 +1,3 @@
2018-10-31 05:05:00 0
2018-10-31 06:06:00 10
2018-10-28 10:00:00 20

View File

@ -0,0 +1,11 @@
DROP TABLE IF EXISTS test.sample_merge_tree;
CREATE TABLE test.sample_merge_tree (dt DateTime, x UInt64) ENGINE = MergeTree PARTITION BY toYYYYMMDD(dt) ORDER BY x SETTINGS min_merge_bytes_to_use_direct_io=1, index_granularity = 8192;
INSERT INTO test.sample_merge_tree VALUES (toDateTime('2018-10-31 05:05:00'), 0), (toDateTime('2018-10-31 06:06:00'), 10), (toDateTime('2018-10-28 10:00:00'), 20);
OPTIMIZE TABLE test.sample_merge_tree FINAL;
SELECT * FROM test.sample_merge_tree ORDER BY x;
DROP TABLE IF EXISTS test.sample_merge_tree;