aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/WhereConstraintsOptimizer.h
blob: 80ee6a3e4bd701cff91939cca3e2a3b3e10a4a30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <Parsers/IAST_fwd.h>

namespace DB
{

class ASTSelectQuery;
struct StorageInMemoryMetadata;
using StorageMetadataPtr = std::shared_ptr<const StorageInMemoryMetadata>;

/// Optimizer that can remove useless parts of conditions
/// in WHERE clause according to table constraints.
class WhereConstraintsOptimizer final
{
public:
    WhereConstraintsOptimizer(
        ASTSelectQuery * select_query,
        const StorageMetadataPtr & metadata_snapshot,
        bool optimize_append_index_);

    void perform();

private:
    ASTSelectQuery * select_query;
    const StorageMetadataPtr & metadata_snapshot;
    bool optimize_append_index;
};

}