ClickHouse/src/Interpreters/AddIndexConstraintsOptimizer.h

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

35 lines
868 B
C++
Raw Normal View History

2021-04-28 17:35:51 +00:00
#pragma once
#include <Parsers/IAST_fwd.h>
#include <Core/Block.h>
#include <Core/NamesAndTypes.h>
#include <Interpreters/Aliases.h>
#include <Interpreters/SelectQueryOptions.h>
#include <Interpreters/DatabaseAndTableWithAlias.h>
#include <Storages/IStorage_fwd.h>
#include <Interpreters/TreeCNFConverter.h>
namespace DB
{
struct StorageInMemoryMetadata;
using StorageMetadataPtr = std::shared_ptr<const StorageInMemoryMetadata>;
2021-11-10 17:57:59 +00:00
/// Optimizer that extracts constraints that
/// depends only on columns of primary key
/// and tries to add function 'indexHint' to
/// WHERE clause, which reduces amount of read data.
2021-04-28 17:35:51 +00:00
class AddIndexConstraintsOptimizer final
{
public:
explicit AddIndexConstraintsOptimizer(const StorageMetadataPtr & metadata_snapshot);
2021-04-28 17:35:51 +00:00
void perform(CNFQuery & cnf_query);
private:
const StorageMetadataPtr & metadata_snapshot;
};
}