mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Revert accident changes
This commit is contained in:
parent
204d0ac955
commit
c6d10e32fc
@ -50,13 +50,10 @@ Block PartLogElement::createBlock()
|
||||
{ColumnUInt64::create(), std::make_shared<DataTypeUInt64>(), "bytes_uncompressed"}, // Result bytes
|
||||
{ColumnUInt64::create(), std::make_shared<DataTypeUInt64>(), "read_rows"},
|
||||
{ColumnUInt64::create(), std::make_shared<DataTypeUInt64>(), "read_bytes"},
|
||||
{ColumnUInt64::create(), std::make_shared<DataTypeUInt64>(), "peak_memory_usage"},
|
||||
|
||||
/// Is there an error during the execution or commit
|
||||
{ColumnUInt16::create(), std::make_shared<DataTypeUInt16>(), "error"},
|
||||
{ColumnString::create(), std::make_shared<DataTypeString>(), "exception"},
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -90,12 +87,10 @@ void PartLogElement::appendToBlock(Block & block) const
|
||||
columns[i++]->insert(bytes_uncompressed);
|
||||
columns[i++]->insert(rows_read);
|
||||
columns[i++]->insert(bytes_read_uncompressed);
|
||||
columns[i++]->insert(peak_memory_usage);
|
||||
|
||||
columns[i++]->insert(error);
|
||||
columns[i++]->insert(exception);
|
||||
|
||||
|
||||
block.setColumns(std::move(columns));
|
||||
}
|
||||
|
||||
|
@ -40,13 +40,11 @@ struct PartLogElement
|
||||
UInt64 bytes_uncompressed = 0;
|
||||
UInt64 rows_read = 0;
|
||||
UInt64 bytes_read_uncompressed = 0;
|
||||
UInt64 peak_memory_usage = 0;
|
||||
|
||||
/// Was the operation successful?
|
||||
UInt16 error = 0;
|
||||
String exception;
|
||||
|
||||
|
||||
static std::string name() { return "PartLog"; }
|
||||
|
||||
static Block createBlock();
|
||||
|
@ -3373,7 +3373,6 @@ try
|
||||
|
||||
part_log_elem.rows = (*merge_entry)->rows_written;
|
||||
part_log_elem.bytes_uncompressed = (*merge_entry)->bytes_written_uncompressed;
|
||||
part_log_elem.peak_memory_usage = (*merge_entry)->memory_tracker.getPeak();
|
||||
}
|
||||
|
||||
part_log->add(part_log_elem);
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include <Storages/MergeTree/MergeTreeData.h>
|
||||
#include <Interpreters/AnalyzedJoin.h>
|
||||
#include <Functions/IFunction.h>
|
||||
#include <Storages/MergeTree/StorageFromMergeTreeDataPart.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -32,28 +31,14 @@ ReadInOrderOptimizer::ReadInOrderOptimizer(
|
||||
|
||||
InputSortingInfoPtr ReadInOrderOptimizer::getInputOrder(const StoragePtr & storage) const
|
||||
{
|
||||
Names sorting_key_columns;
|
||||
if (const auto * merge_tree = dynamic_cast<const MergeTreeData *>(storage.get()))
|
||||
{
|
||||
if (!merge_tree->hasSortingKey())
|
||||
return {};
|
||||
sorting_key_columns = merge_tree->getSortingKeyColumns();
|
||||
}
|
||||
else if (const auto * part = dynamic_cast<const StorageFromMergeTreeDataPart *>(storage.get()))
|
||||
{
|
||||
if (!part->hasSortingKey())
|
||||
return {};
|
||||
sorting_key_columns = part->getSortingKeyColumns();
|
||||
}
|
||||
else /// Inapplicable storage type
|
||||
{
|
||||
const MergeTreeData * merge_tree = dynamic_cast<const MergeTreeData *>(storage.get());
|
||||
if (!merge_tree || !merge_tree->hasSortingKey())
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
SortDescription order_key_prefix_descr;
|
||||
int read_direction = required_sort_description.at(0).direction;
|
||||
|
||||
const auto & sorting_key_columns = merge_tree->getSortingKeyColumns();
|
||||
size_t prefix_size = std::min(required_sort_description.size(), sorting_key_columns.size());
|
||||
|
||||
for (size_t i = 0; i < prefix_size; ++i)
|
||||
|
@ -1 +0,0 @@
|
||||
1
|
@ -1,25 +0,0 @@
|
||||
DROP TABLE IF EXISTS table_with_pk;
|
||||
|
||||
CREATE TABLE table_with_pk
|
||||
(
|
||||
key UInt8,
|
||||
value String
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY key;
|
||||
|
||||
INSERT INTO table_with_pk SELECT number, toString(number % 10) FROM numbers(10000000);
|
||||
|
||||
ALTER TABLE table_with_pk DELETE WHERE key % 77 = 0 SETTINGS mutations_sync = 1;
|
||||
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
-- Memory usage for all mutations must be almost constant and less than
|
||||
-- read_bytes.
|
||||
SELECT
|
||||
DISTINCT read_bytes >= peak_memory_usage
|
||||
FROM
|
||||
system.part_log2
|
||||
WHERE event_type = 'MutatePart' AND table = 'table_with_pk' AND database = currentDatabase();
|
||||
|
||||
DROP TABLE IF EXISTS table_with_pk;
|
Loading…
Reference in New Issue
Block a user