mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
33 lines
874 B
C++
33 lines
874 B
C++
#pragma once
|
|
|
|
#include <Core/SortDescription.h>
|
|
#include <Storages/MergeTree/MergeTreeData.h>
|
|
#include <Storages/SelectQueryInfo.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/** Helper class, that can analyze MergeTree order key
|
|
* and required sort description to get their
|
|
* common prefix, which is needed for
|
|
* performing reading in order of PK.
|
|
*/
|
|
class ReadInOrderOptimizer
|
|
{
|
|
public:
|
|
ReadInOrderOptimizer(
|
|
const ManyExpressionActions & elements_actions,
|
|
const SortDescription & required_sort_description,
|
|
const SyntaxAnalyzerResultPtr & syntax_result);
|
|
|
|
InputSortingInfoPtr getInputOrder(const StoragePtr & storage) const;
|
|
|
|
private:
|
|
/// Actions for every element of order expression to analyze functions for monotonicicy
|
|
ManyExpressionActions elements_actions;
|
|
NameSet forbidden_columns;
|
|
SortDescription required_sort_description;
|
|
};
|
|
|
|
}
|