![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <cstddef>#include <cstdlib>#include <cstring>#include <deque>#include <filesystem>#include <fstream>#include <iostream>#include <memory>#include <mutable/IR/PlanTable.hpp>#include <mutable/mutable.hpp>#include <mutable/Options.hpp>#include <mutable/util/ArgParser.hpp>#include <mutable/util/fn.hpp>#include <random>#include <stdexcept>#include <type_traits>#include <unordered_map>#include <unordered_set>Go to the source code of this file.
Data Structures | |
| struct | skewed_distribution< RealType > |
| A distribution of values in range [0; 1] that are skewed towards 0. More... | |
Macros | |
| #define | ADD(TYPE, VAR, INIT, SHORT, LONG, DESCR, CALLBACK) |
Typedefs | |
| using | Subproblem = m::SmallBitset |
| using | table_type = std::unordered_map< Subproblem, uint64_t, m::SubproblemHash > |
Functions | |
| template<typename Generator > | |
| void | generate_correlated_cardinalities (table_type &table, const m::QueryGraph &G, Generator &&g) |
| template<typename Generator > | |
| void | generate_uncorrelated_cardinalities (table_type &table, const m::QueryGraph &G, Generator &&g) |
| void | emit_cardinalities (std::ostream &out, const m::QueryGraph &G, const table_type &table) |
| void | usage (std::ostream &out, const char *name) |
| int | main (int argc, const char **argv) |
Variables | |
| struct { | |
| bool show_help | |
More... | |
| unsigned seed | |
More... | |
| bool correlated_selectivities | |
More... | |
| std::size_t min_cardinality | |
More... | |
| std::size_t max_cardinality | |
More... | |
| double alpha | |
More... | |
| } | args |
| #define ADD | ( | TYPE, | |
| VAR, | |||
| INIT, | |||
| SHORT, | |||
| LONG, | |||
| DESCR, | |||
| CALLBACK | |||
| ) |
| using Subproblem = m::SmallBitset |
Definition at line 24 of file cardinality_gen.cpp.
| using table_type = std::unordered_map<Subproblem, uint64_t, m::SubproblemHash> |
Definition at line 70 of file cardinality_gen.cpp.
| void emit_cardinalities | ( | std::ostream & | out, |
| const m::QueryGraph & | G, | ||
| const table_type & | table | ||
| ) |
Definition at line 347 of file cardinality_gen.cpp.
References m::Catalog::Get(), m::Catalog::get_database_in_use(), m::Database::name, and m::QueryGraph::sources().
Referenced by main().
| void generate_correlated_cardinalities | ( | table_type & | table, |
| const m::QueryGraph & | G, | ||
| Generator && | g | ||
| ) |
Get the cardinality of
| S. |
Definition at line 219 of file cardinality_gen.cpp.
References m::QueryGraph::adjacency_matrix(), m::SmallBitset::All(), args, m::AdjacencyMatrix::for_each_CSG_pair_undirected(), M_insist, max_cardinality, and m::QueryGraph::num_sources().
Referenced by main().
| void generate_uncorrelated_cardinalities | ( | table_type & | table, |
| const m::QueryGraph & | G, | ||
| Generator && | g | ||
| ) |
Definition at line 270 of file cardinality_gen.cpp.
References m::QueryGraph::adjacency_matrix(), m::SmallBitset::All(), and(), args, m::SmallBitset::begin(), m::SmallBitset::end(), m::AdjacencyMatrix::for_each_CSG_pair_undirected(), m::AdjacencyMatrix::is_connected(), m::QueryGraph::joins(), M_insist, m::QueryGraph::num_joins(), m::QueryGraph::num_sources(), seed, and m::SmallBitset::Singleton().
Referenced by main().
| int main | ( | int | argc, |
| const char ** | argv | ||
| ) |
Definition at line 87 of file cardinality_gen.cpp.
References ADD, alpha, m::Catalog::arg_parser(), m::ArgParser::args(), args, m::QueryGraph::Build(), m::Catalog::Destroy(), emit_cardinalities(), m::execute_file(), generate_correlated_cardinalities(), generate_uncorrelated_cardinalities(), m::Catalog::Get(), m::Options::Get(), m::Catalog::has_database_in_use(), M_insist, m::ArgParser::parse_args(), m::Options::quiet, m::SmallBitset::Singleton(), m::statement_from_string(), and usage().
| void usage | ( | std::ostream & | out, |
| const char * | name | ||
| ) |
Definition at line 80 of file cardinality_gen.cpp.
Referenced by main().
| double alpha |
alpha for skewed distribution
Definition at line 67 of file cardinality_gen.cpp.
Referenced by main().
| struct { ... } args |
Referenced by m::wasm::Module::add_garbage_collected_data(), m::StoreWriter::append(), MockInterface::callImport(), m::ast::FnApplicationExpr::can_be_null(), m::ast::FnApplicationExpr::contains_bound_variables(), m::ast::FnApplicationExpr::contains_free_variables(), m::Catalog::create_instruction(), m::wasm::Module::emit_throw(), m::doubly_linked_list< T, Allocator >::emplace(), m::doubly_linked_list< T, Allocator >::emplace_back(), m::doubly_linked_list< T, Allocator >::emplace_front(), m::exec(), m::InsertRecords::execute(), m::execute_statement(), m::ast::FnApplicationExpr::FnApplicationExpr(), generate_correlated_cardinalities(), generate_uncorrelated_cardinalities(), m::wasm::insist_interpreter(), m::PhysicalOperator::instantiate(), main(), m::make_unsharable_shared(), m::DSVReader::operator()(), m::ast::Parser::parse_Expr(), m::ast::Parser::parse_Instruction(), m::wasm::detail::read_result_set(), m::gs::GridSearch< Spaces >::search(), and m::wasm::throw_interpreter().
| bool correlated_selectivities |
whether selectivities are correlated
Definition at line 61 of file cardinality_gen.cpp.
| std::size_t max_cardinality |
maximum cardinality of relations and intermediate results
Definition at line 65 of file cardinality_gen.cpp.
Referenced by m::InjectionCardinalityEstimator::estimate_join(), generate_correlated_cardinalities(), and m::InjectionCardinalityEstimator::operator()().
| std::size_t min_cardinality |
minimum cardinality of relations and intermediate results
Definition at line 63 of file cardinality_gen.cpp.
| unsigned seed |
the seed for the PRNG
Definition at line 59 of file cardinality_gen.cpp.
Referenced by generate_uncorrelated_cardinalities().
| bool show_help |
whether to show a help message
Definition at line 57 of file cardinality_gen.cpp.
Referenced by main().