Multi-core Hash Joins
Main-memory hash join implementations for multi-core CPUs
Typedefs | Functions
The No Partitioning Optimized Join Implementation

Typedefs

typedef struct arg_t arg_t
 

Functions

void allocate_hashtable (hashtable_t **ppht, uint32_t nbuckets)
 
void destroy_hashtable (hashtable_t *ht)
 
void build_hashtable_st (hashtable_t *ht, relation_t *rel)
 
int64_t probe_hashtable (hashtable_t *ht, relation_t *rel, void *output)
 
result_tNPO_st (relation_t *relR, relation_t *relS, int nthreads)
 
void build_hashtable_mt (hashtable_t *ht, relation_t *rel, bucket_buffer_t **overflowbuf)
 
void * npo_thread (void *param)
 
result_tNPO (relation_t *relR, relation_t *relS, int nthreads)
 

Detailed Description

Typedef Documentation

◆ arg_t

typedef struct arg_t arg_t

Definition at line 88 of file no_partitioning_join.c.

Function Documentation

◆ allocate_hashtable()

void allocate_hashtable ( hashtable_t **  ppht,
uint32_t  nbuckets 
)

Allocates a hashtable of NUM_BUCKETS and inits everything to 0.

Parameters
htpointer to a hashtable_t pointer

Not an elegant way of passing whether we will numa-localize, but this feature is experimental anyway.

Definition at line 183 of file no_partitioning_join.c.

◆ build_hashtable_mt()

void build_hashtable_mt ( hashtable_t ht,
relation_t rel,
bucket_buffer_t **  overflowbuf 
)

Multi-thread hashtable build method, ht is pre-allocated. Writes to buckets are synchronized via latches.

Parameters
hthastable to be built
relthe build relation
overflowbufpre-allocated chunk of buckets for overflow use.

Definition at line 427 of file no_partitioning_join.c.

◆ build_hashtable_st()

void build_hashtable_st ( hashtable_t ht,
relation_t rel 
)

Single-thread hashtable build method, ht is pre-allocated.

Parameters
hthastable to be built
relthe build relation

Definition at line 231 of file no_partitioning_join.c.

◆ destroy_hashtable()

void destroy_hashtable ( hashtable_t ht)

Releases memory allocated for the hashtable.

Parameters
htpointer to hashtable

Definition at line 218 of file no_partitioning_join.c.

◆ NPO()

result_t * NPO ( relation_t relR,
relation_t relS,
int  nthreads 
)

Definition at line 592 of file no_partitioning_join.c.

◆ NPO_st()

result_t * NPO_st ( relation_t relR,
relation_t relS,
int  nthreads 
)

The No Partitioning Join Optimized (NPO) as a single-threaded implementation. Just returns the number of result tuples.

Parameters
relRinput relation R - inner relation
relSinput relation S - outer relation
Returns
number of result tuples

Definition at line 357 of file no_partitioning_join.c.

◆ npo_thread()

void * npo_thread ( void *  param)

Just a wrapper to call the build and probe for each thread.

Parameters
paramthe parameters of the thread, i.e. tid, ht, reln, ...
Returns

Definition at line 492 of file no_partitioning_join.c.

◆ probe_hashtable()

int64_t probe_hashtable ( hashtable_t ht,
relation_t rel,
void *  output 
)

Probes the hashtable for the given outer relation, returns num results. This probing method is used for both single and multi-threaded version.

Parameters
hthashtable to be probed
relthe probing outer relation
outputchained tuple buffer to write join results, i.e. rid pairs.
Returns
number of matching tuples

Definition at line 280 of file no_partitioning_join.c.