26 struct hash<std::vector<int>> {
28 return vec.size() ^ boost::hash_range(vec.begin(), vec.end());
33 struct hash<std::pair<int, int>> {
35 return boost::hash<std::pair<int, int>>()(p);
47 using MergedChunk = std::pair<AbstractBuffer*, AbstractBuffer*>;
61 const size_t thread_idx,
62 std::vector<std::shared_ptr<Chunk_NS::Chunk>>& chunks_owner,
69 const std::vector<Fragmenter_Namespace::FragmentInfo>& fragments,
73 const size_t thread_idx,
74 std::vector<std::shared_ptr<Chunk_NS::Chunk>>& chunks_owner,
75 std::vector<std::shared_ptr<void>>& malloc_owner,
82 const std::map<shared::TableKey, const TableFragments*>& all_tables_fragments,
83 std::list<std::shared_ptr<Chunk_NS::Chunk>>& chunk_holder,
84 std::list<ChunkIter>& chunk_iter_holder,
92 const std::map<shared::TableKey, const TableFragments*>& all_tables_fragments,
96 const size_t thread_idx)
const;
102 const size_t thread_idx)
const;
107 const std::map<shared::TableKey, const TableFragments*>& all_tables_fragments,
108 std::list<std::shared_ptr<Chunk_NS::Chunk>>& chunk_holder,
109 std::list<ChunkIter>& chunk_iter_holder,
113 const size_t thread_idx)
const;
129 std::list<std::shared_ptr<Chunk_NS::Chunk>>& chunk_holder,
130 std::list<ChunkIter>& chunk_iter_holder,
131 std::list<std::shared_ptr<Chunk_NS::Chunk>>& local_chunk_holder,
132 std::list<ChunkIter>& local_chunk_iter_holder,
133 std::list<size_t>& local_chunk_num_tuples,
137 const size_t total_data_buf_size,
138 const size_t total_idx_buf_size,
139 const size_t total_num_tuples,
141 const size_t thread_idx)
const;
145 std::list<std::shared_ptr<Chunk_NS::Chunk>>& chunk_holder,
146 std::list<ChunkIter>& chunk_iter_holder,
147 std::list<std::shared_ptr<Chunk_NS::Chunk>>& local_chunk_holder,
148 std::list<ChunkIter>& local_chunk_iter_holder,
149 std::list<size_t>& local_chunk_num_tuples,
153 const size_t total_data_buf_size,
154 const size_t total_idx_buf_size,
155 const size_t total_num_tuples,
157 const size_t thread_idx)
const;
161 int8_t* chunk_iter_ptr)
const;
164 const int device_id = 0)
const;
169 bool is_true_varlen_type,
170 const size_t total_num_tuples)
const;
178 const size_t thread_idx)
const;
187 mutable std::unordered_map<InputColDescriptor, std::unique_ptr<const ColumnarResults>>
191 mutable std::unordered_map<InputColDescriptor, DeviceMergedChunkIterMap>
193 mutable std::unordered_map<int, AbstractBuffer*>
195 mutable std::unordered_map<InputColDescriptor, DeviceMergedChunkMap>
197 mutable std::unordered_map<InputColDescriptor, DeviceMergedChunkMap>
std::unordered_map< int, int8_t * > DeviceMergedChunkIterMap
std::unordered_map< int, AbstractBuffer * > DeviceMergedChunkMap
std::mutex varlen_chunk_fetch_mutex_
static JoinColumn makeJoinColumn(Executor *executor, const Analyzer::ColumnVar &hash_col, const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments, const Data_Namespace::MemoryLevel effective_mem_lvl, const int device_id, DeviceAllocator *device_allocator, const size_t thread_idx, std::vector< std::shared_ptr< Chunk_NS::Chunk >> &chunks_owner, std::vector< std::shared_ptr< void >> &malloc_owner, ColumnCacheMap &column_cache)
Creates a JoinColumn struct containing an array of JoinChunk structs.
std::mutex columnar_fetch_mutex_
const int8_t * getResultSetColumn(const InputColDescriptor *col_desc, const Data_Namespace::MemoryLevel memory_level, const int device_id, DeviceAllocator *device_allocator, const size_t thread_idx) const
size_t operator()(const std::vector< int > &vec) const
std::shared_ptr< ResultSet > ResultSetPtr
const int8_t * getChunkiter(const InputColDescriptor col_desc, const int device_id=0) const
const int8_t * getOneTableColumnFragment(const shared::TableKey &table_key, const int frag_id, const int col_id, const std::map< shared::TableKey, const TableFragments * > &all_tables_fragments, std::list< std::shared_ptr< Chunk_NS::Chunk >> &chunk_holder, std::list< ChunkIter > &chunk_iter_holder, const Data_Namespace::MemoryLevel memory_level, const int device_id, DeviceAllocator *device_allocator) const
std::mutex linearization_mutex_
std::unordered_map< InputColDescriptor, std::unique_ptr< const ColumnarResults > > columnarized_scan_table_cache_
const int8_t * getAllTableColumnFragments(const shared::TableKey &table_key, const int col_id, const std::map< shared::TableKey, const TableFragments * > &all_tables_fragments, const Data_Namespace::MemoryLevel memory_level, const int device_id, DeviceAllocator *device_allocator, const size_t thread_idx) const
std::unordered_map< InputColDescriptor, DeviceMergedChunkMap > linearized_data_buf_cache_
void addMergedChunkIter(const InputColDescriptor col_desc, const int device_id, int8_t *chunk_iter_ptr) const
std::unordered_map< int, AbstractBuffer * > linearlized_temporary_cpu_index_buf_cache_
ColumnFetcher(Executor *executor, ColumnCacheMap &column_cache)
Used by Fragmenter classes to store info about each fragment - the fragment id and number of tuples(r...
std::mutex linearized_col_cache_mutex_
An AbstractBuffer is a unit of data management for a data manager.
specifies the content in-memory of a row in the column metadata table
MergedChunk linearizeFixedLenArrayColFrags(int32_t db_id, std::list< std::shared_ptr< Chunk_NS::Chunk >> &chunk_holder, std::list< ChunkIter > &chunk_iter_holder, std::list< std::shared_ptr< Chunk_NS::Chunk >> &local_chunk_holder, std::list< ChunkIter > &local_chunk_iter_holder, std::list< size_t > &local_chunk_num_tuples, MemoryLevel memory_level, const ColumnDescriptor *cd, const int device_id, const size_t total_data_buf_size, const size_t total_idx_buf_size, const size_t total_num_tuples, DeviceAllocator *device_allocator, const size_t thread_idx) const
std::mutex chunk_list_mutex_
void freeTemporaryCpuLinearizedIdxBuf()
size_t operator()(const std::pair< int, int > &p) const
static const int8_t * transferColumnIfNeeded(const ColumnarResults *columnar_results, const int col_id, Data_Namespace::DataMgr *data_mgr, const Data_Namespace::MemoryLevel memory_level, const int device_id, DeviceAllocator *device_allocator)
static std::pair< const int8_t *, size_t > getOneColumnFragment(Executor *executor, const Analyzer::ColumnVar &hash_col, const Fragmenter_Namespace::FragmentInfo &fragment, const Data_Namespace::MemoryLevel effective_mem_lvl, const int device_id, DeviceAllocator *device_allocator, const size_t thread_idx, std::vector< std::shared_ptr< Chunk_NS::Chunk >> &chunks_owner, ColumnCacheMap &column_cache)
Gets one chunk's pointer and element count on either CPU or GPU.
MergedChunk linearizeVarLenArrayColFrags(int32_t db_id, std::list< std::shared_ptr< Chunk_NS::Chunk >> &chunk_holder, std::list< ChunkIter > &chunk_iter_holder, std::list< std::shared_ptr< Chunk_NS::Chunk >> &local_chunk_holder, std::list< ChunkIter > &local_chunk_iter_holder, std::list< size_t > &local_chunk_num_tuples, MemoryLevel memory_level, const ColumnDescriptor *cd, const int device_id, const size_t total_data_buf_size, const size_t total_idx_buf_size, const size_t total_num_tuples, DeviceAllocator *device_allocator, const size_t thread_idx) const
const int8_t * linearizeColumnFragments(const shared::TableKey &table_key, const int col_id, const std::map< shared::TableKey, const TableFragments * > &all_tables_fragments, std::list< std::shared_ptr< Chunk_NS::Chunk >> &chunk_holder, std::list< ChunkIter > &chunk_iter_holder, const Data_Namespace::MemoryLevel memory_level, const int device_id, DeviceAllocator *device_allocator, const size_t thread_idx) const
Abstract class for managing device memory allocations.
std::unordered_map< shared::TableKey, std::unordered_map< int, std::shared_ptr< const ColumnarResults >>> ColumnCacheMap
std::pair< AbstractBuffer *, AbstractBuffer * > MergedChunk
std::vector< std::vector< const int8_t * > > col_buffers
ChunkIter prepareChunkIter(AbstractBuffer *merged_data_buf, AbstractBuffer *merged_index_buf, ChunkIter &chunk_iter, bool is_true_varlen_type, const size_t total_num_tuples) const
std::vector< std::vector< int64_t > > num_rows
std::unordered_map< InputColDescriptor, DeviceMergedChunkIterMap > linearized_multi_frag_chunk_iter_cache_
std::vector< std::vector< uint64_t > > frag_offsets
std::unordered_map< InputColDescriptor, DeviceMergedChunkMap > linearized_idx_buf_cache_
Descriptor for the fragments required for an execution kernel.
ColumnCacheMap & columnarized_table_cache_