mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
dbms: development [#CONV-2944].
This commit is contained in:
parent
19a3e788e9
commit
83337ec474
@ -94,7 +94,7 @@ public:
|
||||
*/
|
||||
bool optimize()
|
||||
{
|
||||
return merge();
|
||||
return merge(false);
|
||||
}
|
||||
|
||||
// void drop();
|
||||
@ -225,7 +225,7 @@ private:
|
||||
void getIndexRanges(ASTPtr & query, Range & date_range, Row & primary_prefix, Range & primary_range);
|
||||
|
||||
/// Определяет, какие куски нужно объединять, и запускает их слияние в отдельном потоке.
|
||||
bool merge();
|
||||
bool merge(bool async = true);
|
||||
bool selectPartsToMerge(DataParts::iterator & left, DataParts::iterator & right);
|
||||
void mergeImpl(DataParts::iterator left, DataParts::iterator right);
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ void StorageMergeTree::clearOldParts()
|
||||
}
|
||||
|
||||
|
||||
bool StorageMergeTree::merge()
|
||||
bool StorageMergeTree::merge(bool async)
|
||||
{
|
||||
DataParts::iterator left;
|
||||
DataParts::iterator right;
|
||||
@ -1059,7 +1059,11 @@ bool StorageMergeTree::merge()
|
||||
|
||||
if (selectPartsToMerge(left, right))
|
||||
{
|
||||
if (async)
|
||||
merge_thread = boost::thread(boost::bind(&StorageMergeTree::mergeImpl, this, left, right));
|
||||
else
|
||||
mergeImpl(left, right);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user