PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | SHARED_TUPLESTORE_SINGLE_PASS 0x01 |
Typedefs | |
typedef struct SharedTuplestore | SharedTuplestore |
typedef struct SharedTuplestoreAccessor | SharedTuplestoreAccessor |
Functions | |
size_t | sts_estimate (int participants) |
SharedTuplestoreAccessor * | sts_initialize (SharedTuplestore *sts, int participants, int my_participant_number, size_t meta_data_size, int flags, SharedFileSet *fileset, const char *name) |
SharedTuplestoreAccessor * | sts_attach (SharedTuplestore *sts, int my_participant_number, SharedFileSet *fileset) |
void | sts_end_write (SharedTuplestoreAccessor *accessor) |
void | sts_reinitialize (SharedTuplestoreAccessor *accessor) |
void | sts_begin_parallel_scan (SharedTuplestoreAccessor *accessor) |
void | sts_end_parallel_scan (SharedTuplestoreAccessor *accessor) |
void | sts_puttuple (SharedTuplestoreAccessor *accessor, void *meta_data, MinimalTuple tuple) |
MinimalTuple | sts_parallel_scan_next (SharedTuplestoreAccessor *accessor, void *meta_data) |
#define SHARED_TUPLESTORE_SINGLE_PASS 0x01 |
Definition at line 30 of file sharedtuplestore.h.
typedef struct SharedTuplestore SharedTuplestore |
Definition at line 1 of file sharedtuplestore.h.
typedef struct SharedTuplestoreAccessor SharedTuplestoreAccessor |
Definition at line 1 of file sharedtuplestore.h.
SharedTuplestoreAccessor* sts_attach | ( | SharedTuplestore * | sts, |
int | my_participant_number, | ||
SharedFileSet * | fileset | ||
) |
Definition at line 178 of file sharedtuplestore.c.
References Assert, SharedTuplestoreAccessor::context, CurrentMemoryContext, SharedTuplestoreAccessor::fileset, palloc0(), SharedTuplestoreAccessor::participant, and SharedTuplestoreAccessor::sts.
Referenced by ExecParallelHashEnsureBatchAccessors(), and ExecParallelHashRepartitionRest().
void sts_begin_parallel_scan | ( | SharedTuplestoreAccessor * | accessor | ) |
Definition at line 253 of file sharedtuplestore.c.
References Assert, i, SharedTuplestore::nparticipants, SharedTuplestoreAccessor::participant, SharedTuplestore::participants, PG_USED_FOR_ASSERTS_ONLY, SharedTuplestoreAccessor::read_file, SharedTuplestoreAccessor::read_next_page, SharedTuplestoreAccessor::read_participant, SharedTuplestoreAccessor::sts, sts_end_parallel_scan(), and SharedTuplestoreParticipant::writing.
Referenced by ExecParallelHashJoinNewBatch(), and ExecParallelHashRepartitionRest().
void sts_end_parallel_scan | ( | SharedTuplestoreAccessor * | accessor | ) |
Definition at line 281 of file sharedtuplestore.c.
References BufFileClose(), and SharedTuplestoreAccessor::read_file.
Referenced by ExecHashTableDetach(), ExecHashTableDetachBatch(), ExecParallelHashCloseBatchAccessors(), ExecParallelHashJoinNewBatch(), ExecParallelHashRepartitionRest(), ExecParallelPrepHashTableForUnmatched(), and sts_begin_parallel_scan().
void sts_end_write | ( | SharedTuplestoreAccessor * | accessor | ) |
Definition at line 213 of file sharedtuplestore.c.
References BufFileClose(), SharedTuplestoreAccessor::participant, SharedTuplestore::participants, pfree(), SharedTuplestoreAccessor::sts, sts_flush_chunk(), SharedTuplestoreAccessor::write_chunk, SharedTuplestoreAccessor::write_file, and SharedTuplestoreParticipant::writing.
Referenced by ExecHashTableDetach(), ExecParallelHashCloseBatchAccessors(), ExecParallelHashJoinPartitionOuter(), and MultiExecParallelHash().
size_t sts_estimate | ( | int | participants | ) |
Definition at line 104 of file sharedtuplestore.c.
SharedTuplestoreAccessor* sts_initialize | ( | SharedTuplestore * | sts, |
int | participants, | ||
int | my_participant_number, | ||
size_t | meta_data_size, | ||
int | flags, | ||
SharedFileSet * | fileset, | ||
const char * | name | ||
) |
Definition at line 126 of file sharedtuplestore.c.
References Assert, SharedTuplestoreAccessor::context, CurrentMemoryContext, elog, ERROR, SharedTuplestoreAccessor::fileset, SharedTuplestore::flags, i, SharedTuplestoreParticipant::lock, LWLockInitialize(), LWTRANCHE_SHARED_TUPLESTORE, SharedTuplestore::meta_data_size, name, SharedTuplestore::name, SharedTuplestoreParticipant::npages, SharedTuplestore::nparticipants, palloc0(), SharedTuplestoreAccessor::participant, SharedTuplestore::participants, SharedTuplestoreParticipant::read_page, SharedTuplestoreAccessor::sts, STS_CHUNK_DATA_SIZE, and SharedTuplestoreParticipant::writing.
Referenced by ExecParallelHashJoinSetUpBatches().
MinimalTuple sts_parallel_scan_next | ( | SharedTuplestoreAccessor * | accessor, |
void * | meta_data | ||
) |
Definition at line 495 of file sharedtuplestore.c.
References BufFileClose(), BufFileOpenFileSet(), BufFileReadExact(), BufFileSeekBlock(), SharedTuplestoreAccessor::context, ereport, errcode_for_file_access(), errmsg(), ERROR, SharedTuplestoreAccessor::fileset, SharedFileSet::fs, if(), SharedTuplestoreParticipant::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAXPGPATH, MemoryContextSwitchTo(), name, SharedTuplestoreParticipant::npages, SharedTuplestore::nparticipants, SharedTuplestoreChunk::ntuples, SharedTuplestoreChunk::overflow, SharedTuplestoreAccessor::participant, SharedTuplestore::participants, SharedTuplestoreAccessor::read_bytes, SharedTuplestoreAccessor::read_file, SharedTuplestoreAccessor::read_next_page, SharedTuplestoreAccessor::read_ntuples, SharedTuplestoreAccessor::read_ntuples_available, SharedTuplestoreParticipant::read_page, SharedTuplestoreAccessor::read_participant, SharedTuplestoreAccessor::sts, STS_CHUNK_HEADER_SIZE, STS_CHUNK_PAGES, sts_filename(), and sts_read_tuple().
Referenced by ExecParallelHashJoinNewBatch(), ExecParallelHashJoinOuterGetTuple(), and ExecParallelHashRepartitionRest().
void sts_puttuple | ( | SharedTuplestoreAccessor * | accessor, |
void * | meta_data, | ||
MinimalTuple | tuple | ||
) |
Definition at line 300 of file sharedtuplestore.c.
References Assert, BufFileCreateFileSet(), SharedTuplestoreAccessor::context, SharedTuplestoreChunk::data, SharedTuplestoreAccessor::fileset, SharedFileSet::fs, MAXPGPATH, MemoryContextAllocZero(), MemoryContextSwitchTo(), SharedTuplestore::meta_data_size, Min, name, SharedTuplestoreChunk::ntuples, SharedTuplestoreChunk::overflow, SharedTuplestoreAccessor::participant, SharedTuplestore::participants, size, SharedTuplestoreAccessor::sts, STS_CHUNK_DATA_SIZE, STS_CHUNK_PAGES, sts_filename(), sts_flush_chunk(), MinimalTupleData::t_len, SharedTuplestoreAccessor::write_chunk, SharedTuplestoreAccessor::write_end, SharedTuplestoreAccessor::write_file, SharedTuplestoreAccessor::write_pointer, and SharedTuplestoreParticipant::writing.
Referenced by ExecParallelHashJoinPartitionOuter(), ExecParallelHashRepartitionFirst(), ExecParallelHashRepartitionRest(), and ExecParallelHashTableInsert().
void sts_reinitialize | ( | SharedTuplestoreAccessor * | accessor | ) |
Definition at line 234 of file sharedtuplestore.c.
References i, SharedTuplestore::nparticipants, SharedTuplestore::participants, SharedTuplestoreParticipant::read_page, and SharedTuplestoreAccessor::sts.