dbms: development [#CONV-2944].

This commit is contained in:
Alexey Milovidov 2012-08-01 19:55:05 +00:00
parent c960aea504
commit 4c931f147f
2 changed files with 12 additions and 1 deletions

View File

@ -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;
};
}

View File

@ -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;
}