mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Macros | Functions | Variables
CostModel.cpp File Reference
#include <mutable/catalog/CostModel.hpp>
#include "storage/ColumnStore.hpp"
#include "storage/store_manip.hpp"
#include "util/GridSearch.hpp"
#include "util/stream.hpp"
#include <mutable/catalog/TrainedCostFunction.hpp>
#include <mutable/mutable.hpp>
#include <type_traits>
Include dependency graph for CostModel.cpp:

Go to the source code of this file.

Macros

#define DEFINE(TYPE)
 

Functions

uint64_t get_column_offset_in_bytes (const DataLayout &layout, std::size_t idx)
 Returns the offset in bytes of the idx-th column in the DataLayout layout which is considered to represent a PAX-layout.
 
void save_csv (const std::string &csv_path, const Eigen::MatrixXd &matrix, const std::string &header="")
 Save matrix in a csv file.
 
Timer::duration time_select_query_execution (Database &DB, const std::string &input)
 Executes the given query and returns the median of query execution times for all SELECT queries.
 
template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_filter ()
 Generates data for training filter models.
 
template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_group_by ()
 Generates data for training group-by-models.
 
template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_join ()
 Generates data for training join-models.
 
 DEFINE (int8_t)
 
 DEFINE (int16_t)
 
 DEFINE (int32_t)
 
 DEFINE (int64_t)
 
 DEFINE (float)
 
 DEFINE (double)
 

Variables

static constexpr std::size_t NUM_DISTINCT_VALUES_IN_FILTER_EXPERIMENT = 100
 
static constexpr unsigned DEFAULT_FILTER_POLYNOMIAL_DEGREE = 9
 
constexpr unsigned NUM_REPETITIONS = 5
 The number of times a benchmark should be repeated to reduce noise in the data.
 

Macro Definition Documentation

◆ DEFINE

#define DEFINE (   TYPE)
Value:
template CostModel CostModelFactory::generate_filter_cost_model<TYPE>(unsigned degree, const char *csv_folder_path); \
template CostModel CostModelFactory::generate_group_by_cost_model<TYPE>(const char *csv_folder_path); \
template CostModel CostModelFactory::generate_join_cost_model<TYPE>(const char *csv_folder_path)
A model for predicting the costs of a physical operator.
Definition: LinearModel.hpp:11

Definition at line 598 of file CostModel.cpp.

Function Documentation

◆ DEFINE() [1/6]

DEFINE ( double  )

◆ DEFINE() [2/6]

DEFINE ( float  )

◆ DEFINE() [3/6]

DEFINE ( int16_t  )

◆ DEFINE() [4/6]

DEFINE ( int32_t  )

◆ DEFINE() [5/6]

DEFINE ( int64_t  )

◆ DEFINE() [6/6]

DEFINE ( int8_t  )

◆ generate_training_suite_filter()

template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_filter ( )

◆ generate_training_suite_group_by()

template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_group_by ( )

◆ generate_training_suite_join()

template<typename T >
std::pair< Eigen::MatrixXd, Eigen::VectorXd > generate_training_suite_join ( )

◆ get_column_offset_in_bytes()

uint64_t get_column_offset_in_bytes ( const DataLayout layout,
std::size_t  idx 
)

Returns the offset in bytes of the idx-th column in the DataLayout layout which is considered to represent a PAX-layout.

Definition at line 28 of file CostModel.cpp.

References m::storage::DataLayout::child(), and M_insist.

Referenced by generate_training_suite_filter(), generate_training_suite_group_by(), and generate_training_suite_join().

◆ save_csv()

void save_csv ( const std::string &  csv_path,
const Eigen::MatrixXd &  matrix,
const std::string &  header = "" 
)

◆ time_select_query_execution()

Timer::duration time_select_query_execution ( Database DB,
const std::string &  input 
)

Executes the given query and returns the median of query execution times for all SELECT queries.


Definition at line 60 of file CostModel.cpp.

References m::execute_query(), m::Catalog::Get(), NUM_REPETITIONS, and m::statement_from_string().

Referenced by generate_training_suite_filter(), generate_training_suite_group_by(), and generate_training_suite_join().

Variable Documentation

◆ DEFAULT_FILTER_POLYNOMIAL_DEGREE

constexpr unsigned DEFAULT_FILTER_POLYNOMIAL_DEGREE = 9
staticconstexpr

Definition at line 17 of file CostModel.cpp.

Referenced by m::CostModelFactory::get_cost_function().

◆ NUM_DISTINCT_VALUES_IN_FILTER_EXPERIMENT

constexpr std::size_t NUM_DISTINCT_VALUES_IN_FILTER_EXPERIMENT = 100
staticconstexpr

Definition at line 16 of file CostModel.cpp.

Referenced by generate_training_suite_filter().

◆ NUM_REPETITIONS

constexpr unsigned NUM_REPETITIONS = 5
constexpr

The number of times a benchmark should be repeated to reduce noise in the data.

Definition at line 19 of file CostModel.cpp.

Referenced by time_select_query_execution().