ClickHouse/src/Interpreters/WhereConstraintsOptimizer.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
665 B
C++
Raw Normal View History

2021-01-04 20:55:32 +00:00
#pragma once
#include <Parsers/IAST_fwd.h>
namespace DB
{
class ASTSelectQuery;
2021-01-04 20:55:32 +00:00
struct StorageInMemoryMetadata;
using StorageMetadataPtr = std::shared_ptr<const StorageInMemoryMetadata>;
2021-11-10 17:57:59 +00:00
/// Optimizer that can remove useless parts of conditions
/// in WHERE clause according to table constraints.
2021-01-04 20:55:32 +00:00
class WhereConstraintsOptimizer final
{
public:
2021-05-04 18:43:58 +00:00
WhereConstraintsOptimizer(
ASTSelectQuery * select_query,
2021-05-04 19:18:37 +00:00
const StorageMetadataPtr & metadata_snapshot,
2021-11-10 17:57:59 +00:00
bool optimize_append_index_);
2021-01-04 20:55:32 +00:00
void perform();
private:
ASTSelectQuery * select_query;
const StorageMetadataPtr & metadata_snapshot;
2021-05-04 19:18:37 +00:00
bool optimize_append_index;
2021-01-04 20:55:32 +00:00
};
}