mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Little improvement for large number of small inserts [#METR-22327].
This commit is contained in:
parent
cfcdb3f881
commit
b19e61757e
@ -119,9 +119,12 @@ private:
|
||||
MergeTreeDataWriter writer;
|
||||
MergeTreeDataMerger merger;
|
||||
|
||||
/// Для нумерации блоков.
|
||||
/// For block numbers.
|
||||
SimpleIncrement increment;
|
||||
|
||||
/// For clearOldParts, clearOldTemporaryDirectories.
|
||||
StopwatchWithLock time_after_previous_cleanup;
|
||||
|
||||
MergeTreeData::DataParts currently_merging;
|
||||
std::mutex currently_merging_mutex;
|
||||
|
||||
|
@ -296,9 +296,12 @@ bool StorageMergeTree::merge(
|
||||
const String & partition,
|
||||
bool final)
|
||||
{
|
||||
/// Удаляем старые куски.
|
||||
data.clearOldParts();
|
||||
data.clearOldTemporaryDirectories(); /// TODO Делать это реже.
|
||||
/// Clear old parts. It does not matter to do it more frequently than each second.
|
||||
if (time_after_previous_cleanup.lockTestAndRestart(1))
|
||||
{
|
||||
data.clearOldParts();
|
||||
data.clearOldTemporaryDirectories();
|
||||
}
|
||||
|
||||
auto structure_lock = lockStructure(true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user