#pragma once #include #include #include #include #include #include #include namespace DB { struct StorageInMemoryMetadata; using StorageMetadataPtr = std::shared_ptr; /// Optimizer that tries to replace columns to equal columns (according to constraints) /// with lower size (accorsing to compressed and uncomressed size). class SubstituteColumnOptimizer { public: SubstituteColumnOptimizer( ASTSelectQuery * select_query, const StorageMetadataPtr & metadata_snapshot, const ConstStoragePtr & storage); void perform(); private: ASTSelectQuery * select_query; const StorageMetadataPtr & metadata_snapshot; ConstStoragePtr storage; }; }