OmniSciDB
85c2d10cdc
|
#include "Execute.h"
#include "AggregateUtils.h"
#include "CodeGenerator.h"
#include "ColumnFetcher.h"
#include "Descriptors/QueryCompilationDescriptor.h"
#include "Descriptors/QueryFragmentDescriptor.h"
#include "DynamicWatchdog.h"
#include "EquiJoinCondition.h"
#include "ErrorHandling.h"
#include "ExpressionRewrite.h"
#include "ExternalCacheInvalidators.h"
#include "GpuMemUtils.h"
#include "InPlaceSort.h"
#include "JoinHashTable/BaselineJoinHashTable.h"
#include "JoinHashTable/OverlapsJoinHashTable.h"
#include "JsonAccessors.h"
#include "OutputBufferInitialization.h"
#include "QueryEngine/QueryDispatchQueue.h"
#include "QueryRewrite.h"
#include "QueryTemplateGenerator.h"
#include "ResultSetReductionJIT.h"
#include "RuntimeFunctions.h"
#include "SpeculativeTopN.h"
#include "TableFunctions/TableFunctionCompilationContext.h"
#include "TableFunctions/TableFunctionExecutionContext.h"
#include "CudaMgr/CudaMgr.h"
#include "DataMgr/BufferMgr/BufferMgr.h"
#include "Parser/ParserNode.h"
#include "Shared/SystemParameters.h"
#include "Shared/TypedDataAccessors.h"
#include "Shared/checked_alloc.h"
#include "Shared/measure.h"
#include "Shared/misc.h"
#include "Shared/scope.h"
#include "Shared/shard_key.h"
#include "Shared/threadpool.h"
#include "AggregatedColRange.h"
#include "StringDictionaryGenerations.h"
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <chrono>
#include <ctime>
#include <future>
#include <iostream>
#include <memory>
#include <numeric>
#include <set>
#include <thread>
#include "ArrayOps.cpp"
#include "DateAdd.cpp"
#include "StringFunctions.cpp"
Go to the source code of this file.
Classes | |
class | anonymous_namespace{Execute.cpp}::OutVecOwner |
Namespaces | |
anonymous_namespace{Execute.cpp} | |
Macros | |
#define | EXECUTE_INCLUDE |
#define EXECUTE_INCLUDE |
Definition at line 3413 of file Execute.cpp.
block_size_x_ | ( | block_size_x | ) |
catalog_ | ( | nullptr | ) |
Referenced by Fragmenter_Namespace::InsertOrderFragmenter::addColumns(), Executor::addDeletedColumn(), Executor::blockSize(), Executor::collectAllDeviceResults(), Executor::collectAllDeviceShardedTopResults(), Executor::computeColRangesCache(), Executor::computeStringDictionaryGenerations(), Fragmenter_Namespace::InsertOrderFragmenter::conditionallyInstantiateFileMgrWithParams(), Executor::createKernels(), Fragmenter_Namespace::InsertOrderFragmenter::deleteFragments(), Executor::deviceCount(), Executor::deviceCycles(), Executor::executeWorkUnitImpl(), Executor::getCatalog(), Executor::getColLazyFetchInfo(), Executor::getColumnDescriptor(), Executor::getNumBytesForFetchedRow(), Executor::getPhysicalColumnDescriptor(), ResultSet::getStringDictionaryPayloadCopy(), Executor::gridSize(), Fragmenter_Namespace::InsertOrderFragmenter::insertData(), Executor::isArchMaxwell(), Executor::isCPUOnly(), Executor::isFragmentFullyDeleted(), Executor::numBlocksPerMP(), ResultSet::radixSortOnGpu(), Executor::reduceMultiDeviceResults(), Executor::reduceMultiDeviceResultSets(), Executor::resultsUnion(), Executor::setCatalog(), Executor::setupCaching(), Executor::skipFragment(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), and Executor::warpSize().
cpu_code_cache_ | ( | code_cache_size | ) |
debug_dir_ | ( | debug_dir | ) |
debug_file_ | ( | debug_file | ) |
executor_id_ | ( | executor_id | ) |
Referenced by Executor::attachExecutorToQuerySession(), Executor::clearQuerySessionStatus(), Executor::enrollQuerySession(), Executor::executeUpdate(), Executor::executeWorkUnit(), Executor::removeFromQuerySessionList(), and Executor::updateQuerySessionStatus().
std::unordered_set<int> get_available_gpus | ( | const Catalog_Namespace::Catalog & | cat | ) |
Definition at line 1032 of file Execute.cpp.
References CHECK_GT, Data_Namespace::DataMgr::getCudaMgr(), Catalog_Namespace::Catalog::getDataMgr(), CudaMgr_Namespace::CudaMgr::getDeviceCount(), and Data_Namespace::DataMgr::gpusPresent().
Referenced by Executor::executeWorkUnitImpl().
size_t get_context_count | ( | const ExecutorDeviceType | device_type, |
const size_t | cpu_count, | ||
const size_t | gpu_count | ||
) |
Definition at line 1044 of file Execute.cpp.
References GPU.
Referenced by Executor::executeWorkUnitImpl().
std::map<size_t, std::vector<uint64_t> > get_table_id_to_frag_offsets | ( | const std::vector< InputDescriptor > & | input_descs, |
const std::map< int, const TableFragments * > & | all_tables_fragments | ||
) |
Definition at line 2316 of file Execute.cpp.
Referenced by Executor::getRowCountAndOffsetForAllFrags().
gpu_code_cache_ | ( | code_cache_size | ) |
grid_size_x_ | ( | grid_size_x | ) |
Referenced by Executor::gridSize(), and Executor::numBlocksPerMP().
input_table_info_cache_ | ( | this | ) |
Definition at line 159 of file Execute.cpp.
Referenced by Executor::clearMetaInfoCache(), and Executor::getTableInfo().
bool is_trivial_loop_join | ( | const std::vector< InputTableInfo > & | query_infos, |
const RelAlgExecutionUnit & | ra_exe_unit | ||
) |
Definition at line 1152 of file Execute.cpp.
References CHECK, g_trivial_loop_join_threshold, i, and RelAlgExecutionUnit::input_descs.
Referenced by anonymous_namespace{IRCodegen.cpp}::check_if_loop_join_is_allowed().
max_gpu_slab_size_ | ( | max_gpu_slab_size | ) |
std::ostream& operator<< | ( | std::ostream & | os, |
const RelAlgExecutionUnit & | ra_exe_unit | ||
) |
Definition at line 1278 of file Execute.cpp.
References RelAlgExecutionUnit::estimator, anonymous_namespace{Execute.cpp}::expr_container_to_string(), RelAlgExecutionUnit::groupby_exprs, i, RelAlgExecutionUnit::input_col_descs, join(), RelAlgExecutionUnit::join_quals, anonymous_namespace{Execute.cpp}::join_type_to_string(), RelAlgExecutionUnit::quals, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, anonymous_namespace{Execute.cpp}::sort_algorithm_to_string(), RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::target_exprs, to_string(), toString(), RelAlgExecutionUnit::union_all, and RelAlgExecutionUnit::use_bump_allocator.
std::ostream& operator<< | ( | std::ostream & | os, |
FetchResult const & | fetch_result | ||
) |
Definition at line 2423 of file Execute.cpp.
References FetchResult::col_buffers, FetchResult::frag_offsets, FetchResult::num_rows, and shared::printContainer().
std::string ra_exec_unit_desc_for_caching | ( | const RelAlgExecutionUnit & | ra_exe_unit | ) |
Definition at line 1227 of file Execute.cpp.
References RelAlgExecutionUnit::estimator, RelAlgExecutionUnit::groupby_exprs, i, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::join_quals, anonymous_namespace{Execute.cpp}::join_type_to_string(), RelAlgExecutionUnit::quals, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::target_exprs, to_string(), and toString().
Referenced by RelAlgExecutor::executeWorkUnit().
temporary_tables_ | ( | nullptr | ) |
false |
Definition at line 76 of file Execute.cpp.
bool g_allow_cpu_retry {true} |
Definition at line 81 of file Execute.cpp.
Referenced by RelAlgExecutor::executeRelAlgQuery(), CommandLineOptions::fillOptions(), and RelAlgExecutor::handlePersistentError().
size_t g_approx_quantile_buffer {1000} |
Definition at line 133 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions(), and RowSetMemoryOwner::nullTDigest().
size_t g_approx_quantile_centroids {300} |
Definition at line 134 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions(), and RowSetMemoryOwner::nullTDigest().
size_t g_big_group_threshold {20000} |
Definition at line 102 of file Execute.cpp.
Referenced by RelAlgExecutor::executeWorkUnit().
double g_bump_allocator_step_reduction {0.75} |
Definition at line 110 of file Execute.cpp.
Referenced by create_dev_group_by_buffers().
bool g_cache_string_hash |
Definition at line 45 of file StringDictionary.cpp.
size_t g_constrained_by_in_threshold {10} |
Definition at line 101 of file Execute.cpp.
Referenced by QueryRewriter::rewriteConstrainedByInImpl().
unsigned g_dynamic_watchdog_time_limit {10000} |
Definition at line 80 of file Execute.cpp.
Referenced by DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), and CommandLineOptions::parse_command_line().
bool g_enable_bump_allocator {false} |
Definition at line 109 of file Execute.cpp.
Referenced by anonymous_namespace{RelAlgExecutor.cpp}::can_use_bump_allocator(), and CommandLineOptions::fillAdvancedOptions().
bool g_enable_columnar_output {false} |
Definition at line 93 of file Execute.cpp.
Referenced by QueryRunner::QueryRunner::defaultExecutionOptionsForRunSQL(), DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), CommandLineOptions::fillAdvancedOptions(), QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down(), and QueryRunner::QueryRunner::runSQLWithAllowingInterrupt().
bool g_enable_direct_columnarization {true} |
Definition at line 111 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions(), and ResultSet::isDirectColumnarConversionPossible().
bool g_enable_dynamic_watchdog {false} |
Definition at line 77 of file Execute.cpp.
Referenced by Executor::buildHashTableForQualifier(), check_watchdog_rt(), DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), Executor::executePlanWithGroupBy(), Executor::executePlanWithoutGroupBy(), RelAlgExecutor::executeRelAlgQueryNoRetry(), Executor::fetchChunks(), anonymous_namespace{ResultSetReductionJIT.cpp}::generate_loop_body(), DBHandler::interrupt(), Executor::interrupt(), QueryExecutionContext::launchGpuCode(), CommandLineOptions::parse_command_line(), RelAlgExecutor::prepareLeafExecution(), ResultSetStorage::reduceEntriesNoCollisionsColWise(), ResultSetStorage::reduceOneEntryBaseline(), and Executor::resetInterrupt().
bool g_enable_experimental_string_functions |
Definition at line 39 of file RelAlgTranslator.cpp.
bool g_enable_filter_function {true} |
Definition at line 79 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions().
bool g_enable_filter_push_down {false} |
Definition at line 89 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), CommandLineOptions::parse_command_line(), QueryRunner::QueryRunner::runSelectQuery(), and DBHandler::sql_execute_impl().
bool g_enable_hashjoin_many_to_many {false} |
Definition at line 97 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and rewrite_overlaps_conjunction().
bool g_enable_lazy_fetch {true} |
Definition at line 113 of file Execute.cpp.
Referenced by QueryCompilationDescriptor::compile(), and CommandLineOptions::fillAdvancedOptions().
bool g_enable_left_join_filter_hoisting {true} |
Definition at line 94 of file Execute.cpp.
Referenced by Executor::buildHoistLeftHandSideFiltersCb(), and CommandLineOptions::fillAdvancedOptions().
bool g_enable_non_kernel_time_query_interrupt {true} |
Definition at line 115 of file Execute.cpp.
Referenced by Parser::checkInterrupt(), anonymous_namespace{Importer.cpp}::checkInterrupt(), ColumnarResults::compactAndCopyEntriesWithoutTargetSkipping(), ColumnarResults::compactAndCopyEntriesWithTargetSkipping(), Parser::CopyTableStmt::execute(), anonymous_namespace{ResultSetReductionJIT.cpp}::generate_loop_body(), ColumnFetcher::getAllTableColumnFragments(), QueryExecutionContext::groupBufferToDeinterleavedResults(), DBHandler::import_geo_table(), DBHandler::import_table(), import_export::Importer::importGDAL(), DBHandler::interrupt(), Executor::interrupt(), DBHandler::interruptQuery(), ColumnFetcher::linearizeColumnFragments(), ColumnarResults::locateAndCountEntries(), ColumnFetcher::makeJoinColumn(), ColumnarResults::materializeAllColumnsThroughIteration(), ColumnarResults::materializeAllLazyColumns(), CommandLineOptions::parse_command_line(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetStorage::reduceEntriesNoCollisionsColWise(), and Executor::resetInterrupt().
bool g_enable_overlaps_hashjoin {true} |
Definition at line 96 of file Execute.cpp.
Referenced by Executor::buildHashTableForQualifier(), CodeGenerator::codegenOverlaps(), CommandLineOptions::fillOptions(), HashJoin::getInstance(), and QueryRewriter::rewriteOverlapsJoin().
bool g_enable_runtime_query_interrupt {false} |
Definition at line 114 of file Execute.cpp.
Referenced by Executor::enableRuntimeQueryInterrupt(), DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), DBHandler::interrupt(), Executor::interrupt(), DBHandler::interruptQuery(), CommandLineOptions::parse_command_line(), Executor::resetInterrupt(), DBHandler::sql_execute_df(), and DBHandler::sql_execute_impl().
bool g_enable_smem_group_by |
Referenced by CommandLineOptions::fillAdvancedOptions().
bool g_enable_smem_grouped_non_count_agg |
Definition at line 124 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions().
bool g_enable_smem_non_grouped_agg |
Definition at line 127 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions().
bool g_enable_table_functions {false} |
Definition at line 104 of file Execute.cpp.
Referenced by RelAlgExecutor::executeTableFunction(), CommandLineOptions::fillAdvancedOptions(), and table_functions::TableFunctionsFactory::reset().
bool g_enable_window_functions {true} |
Definition at line 103 of file Execute.cpp.
Referenced by RelAlgExecutor::executeWorkUnit(), and CommandLineOptions::fillAdvancedOptions().
float g_filter_push_down_high_frac {-1.0f} |
Definition at line 91 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and FilterSelectivity::isFilterSelectiveEnough().
float g_filter_push_down_low_frac {-1.0f} |
Definition at line 90 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and FilterSelectivity::isFilterSelectiveEnough().
size_t g_filter_push_down_passing_row_ubound {0} |
Definition at line 92 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and FilterSelectivity::isFilterSelectiveEnough().
bool g_from_table_reordering {true} |
Definition at line 84 of file Execute.cpp.
Referenced by RelAlgExecutor::createCompoundWorkUnit(), RelAlgExecutor::createProjectWorkUnit(), CommandLineOptions::fillOptions(), and CommandLineOptions::parse_command_line().
size_t g_gpu_smem_threshold |
Definition at line 119 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions().
bool g_inner_join_fragment_skipping {true} |
Definition at line 85 of file Execute.cpp.
Referenced by Executor::createKernels(), and CommandLineOptions::fillOptions().
bool g_is_test_env {false} |
Definition at line 130 of file Execute.cpp.
Referenced by Executor::getArenaBlockSize().
size_t g_max_memory_allocation_size {2000000000} |
Definition at line 105 of file Execute.cpp.
Referenced by create_dev_group_by_buffers(), CommandLineOptions::fillAdvancedOptions(), and QueryMemoryInitializer::QueryMemoryInitializer().
size_t g_min_memory_allocation_size |
Definition at line 106 of file Execute.cpp.
Referenced by create_dev_group_by_buffers(), and CommandLineOptions::fillAdvancedOptions().
bool g_null_div_by_zero {false} |
Definition at line 82 of file Execute.cpp.
Referenced by CodeGenerator::codegenDiv(), CommandLineOptions::fillOptions(), and ExpressionRange::operator/().
bool g_optimize_row_initialization {true} |
Definition at line 95 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions(), and QueryMemoryInitializer::initRowGroups().
size_t g_overlaps_max_table_size_bytes {1024 * 1024 * 1024} |
Definition at line 98 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and OverlapsJoinHashTable::reifyWithLayout().
double g_overlaps_target_entries_per_bin {1.3} |
Definition at line 99 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and OverlapsJoinHashTable::reifyWithLayout().
unsigned g_pending_query_interrupt_freq {1000} |
Definition at line 117 of file Execute.cpp.
Referenced by Executor::enableRuntimeQueryInterrupt(), DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), RelAlgExecutor::executeRelAlgQueryNoRetry(), and CommandLineOptions::parse_command_line().
double g_running_query_interrupt_freq {0.5} |
Definition at line 118 of file Execute.cpp.
Referenced by Executor::enableRuntimeQueryInterrupt(), DBHandler::execute_rel_alg(), DBHandler::execute_rel_alg_df(), and CommandLineOptions::parse_command_line().
bool g_strip_join_covered_quals {false} |
Definition at line 100 of file Execute.cpp.
Referenced by CommandLineOptions::fillAdvancedOptions(), and strip_join_covered_filter_quals().
unsigned g_trivial_loop_join_threshold {1000} |
Definition at line 83 of file Execute.cpp.
Referenced by CommandLineOptions::fillOptions(), and is_trivial_loop_join().
bool g_use_estimator_result_cache {true} |
Definition at line 116 of file Execute.cpp.
Referenced by Executor::addToCardinalityCache(), Executor::getCachedCardinality(), and CommandLineOptions::parse_command_line().
bool g_use_tbb_pool {false} |
Definition at line 78 of file Execute.cpp.
Referenced by Executor::executeWorkUnitImpl(), CommandLineOptions::fillAdvancedOptions(), and ResultSet::parallelRowCount().
std::unique_ptr<llvm::Module> udf_cpu_module |
Definition at line 74 of file NativeCodegen.cpp.
std::unique_ptr<llvm::Module> udf_gpu_module |
Definition at line 73 of file NativeCodegen.cpp.
Referenced by get_gpu_data_layout().