mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
dbms: development [#CONV-2944].
This commit is contained in:
parent
c960aea504
commit
4c931f147f
@ -17,7 +17,7 @@ class MergingSortedBlockInputStream : public IProfilingBlockInputStream
|
||||
public:
|
||||
MergingSortedBlockInputStream(BlockInputStreams inputs_, SortDescription & description_, size_t max_block_size_)
|
||||
: inputs(inputs_), description(description_), max_block_size(max_block_size_), first(true),
|
||||
num_columns(0), source_blocks(inputs.size()), cursors(inputs.size())
|
||||
num_columns(0), source_blocks(inputs.size()), cursors(inputs.size()), log(&Logger::get("MergingSortedBlockInputStream"))
|
||||
{
|
||||
children.insert(children.end(), inputs.begin(), inputs.end());
|
||||
}
|
||||
@ -44,6 +44,8 @@ private:
|
||||
|
||||
typedef std::priority_queue<SortCursor> Queue;
|
||||
Queue queue;
|
||||
|
||||
Logger * log;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <queue>
|
||||
#include <iomanip>
|
||||
|
||||
#include <DB/DataStreams/MergingSortedBlockInputStream.h>
|
||||
|
||||
@ -106,6 +107,14 @@ Block MergingSortedBlockInputStream::readImpl()
|
||||
return merged_block;
|
||||
}
|
||||
|
||||
const BlockStreamProfileInfo & profile_info = getInfo();
|
||||
double seconds = profile_info.work_stopwatch.elapsedSeconds();
|
||||
LOG_DEBUG(log, std::fixed << std::setprecision(2)
|
||||
<< "Merge sorted " << profile_info.blocks << " blocks, " << profile_info.rows << " rows"
|
||||
<< " in " << seconds << " sec., "
|
||||
<< profile_info.rows / seconds << " rows/sec., "
|
||||
<< profile_info.bytes / 1000000.0 / seconds << " MiB/sec.");
|
||||
|
||||
inputs.clear();
|
||||
return merged_block;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user