Revert "Adjust minMax index"

This reverts commit c69f587f8a.
This commit is contained in:
kssenii 2021-05-21 12:01:08 +00:00
parent c69f587f8a
commit bd0bc8e3e7
2 changed files with 5 additions and 8 deletions

View File

@ -497,7 +497,7 @@ QueryPlanPtr MergeTreeDataSelectExecutor::readFromParts(
DataTypes minmax_columns_types; DataTypes minmax_columns_types;
if (metadata_snapshot_base->hasPartitionKey()) if (metadata_snapshot_base->hasPartitionKey())
{ {
const auto & partition_key = MergeTreePartition::adjustPartitionKey(metadata_snapshot_base, context); const auto & partition_key = metadata_snapshot_base->getPartitionKey();
auto minmax_columns_names = data.getMinMaxColumnsNames(partition_key); auto minmax_columns_names = data.getMinMaxColumnsNames(partition_key);
minmax_columns_types = data.getMinMaxColumnsTypes(partition_key); minmax_columns_types = data.getMinMaxColumnsTypes(partition_key);
@ -1175,8 +1175,7 @@ QueryPlanPtr MergeTreeDataSelectExecutor::readFromParts(
settings, settings,
reader_settings, reader_settings,
result_projection, result_projection,
query_id, query_id);
context);
} }
else if ((settings.optimize_read_in_order || settings.optimize_aggregation_in_order) && input_order_info) else if ((settings.optimize_read_in_order || settings.optimize_aggregation_in_order) && input_order_info)
{ {
@ -1677,8 +1676,7 @@ QueryPlanPtr MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreamsFinal(
const Settings & settings, const Settings & settings,
const MergeTreeReaderSettings & reader_settings, const MergeTreeReaderSettings & reader_settings,
ActionsDAGPtr & out_projection, ActionsDAGPtr & out_projection,
const String & query_id, const String & query_id) const
ContextPtr context) const
{ {
const auto data_settings = data.getSettings(); const auto data_settings = data.getSettings();
size_t sum_marks = 0; size_t sum_marks = 0;
@ -1828,7 +1826,7 @@ QueryPlanPtr MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreamsFinal(
size_t sort_columns_size = sort_columns.size(); size_t sort_columns_size = sort_columns.size();
sort_description.reserve(sort_columns_size); sort_description.reserve(sort_columns_size);
Names partition_key_columns = MergeTreePartition::adjustPartitionKey(metadata_snapshot, context).column_names; Names partition_key_columns = metadata_snapshot->getPartitionKey().column_names;
const auto & header = plan->getCurrentDataStream().header; const auto & header = plan->getCurrentDataStream().header;
for (size_t i = 0; i < sort_columns_size; ++i) for (size_t i = 0; i < sort_columns_size; ++i)

View File

@ -114,8 +114,7 @@ private:
const Settings & settings, const Settings & settings,
const MergeTreeReaderSettings & reader_settings, const MergeTreeReaderSettings & reader_settings,
ActionsDAGPtr & out_projection, ActionsDAGPtr & out_projection,
const String & query_id, const String & query_id) const;
ContextPtr context) const;
/// Get the approximate value (bottom estimate - only by full marks) of the number of rows falling under the index. /// Get the approximate value (bottom estimate - only by full marks) of the number of rows falling under the index.
size_t getApproximateTotalRowsToRead( size_t getApproximateTotalRowsToRead(