MCPcopy Create free account
hub / github.com/cwida/ALP / joinSel

Method joinSel

publication/source_code/bench_end_to_end/src/vectorwise/Operators.cpp:402–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402pos_t Hashjoin::joinSel() {
403 size_t found = 0;
404 // perform continuation
405 for (auto entry = cont.buildMatch; entry != shared.ht.end(); entry = entry->next) {
406 if (entry->hash == cont.probeHash) {
407 buildMatches[found] = entry;
408 probeMatches[found++] = probeSel[cont.nextProbe];
409 if (found == batchSize) {
410 // output buffers are full, save state for continuation
411 cont.buildMatch = entry->next;
412 return batchSize;
413 }
414 }
415 }
416 if (cont.buildMatch != shared.ht.end()) cont.nextProbe++;
417 for (size_t i = cont.nextProbe, end = cont.numProbes; i < end; ++i) {
418 auto hash = probeHashes[i];
419 for (auto entry = shared.ht.find_chain_tagged(hash); entry != shared.ht.end(); entry = entry->next) {
420 if (entry->hash == hash) {
421 buildMatches[found] = entry;
422 probeMatches[found++] = probeSel[i];
423 if (found == batchSize && (entry->next || i + 1 < end)) {
424 // output buffers are full, save state for continuation
425 cont.buildMatch = entry->next;
426 cont.probeHash = hash;
427 cont.nextProbe = i;
428 return batchSize;
429 }
430 }
431 }
432 }
433 cont.buildMatch = shared.ht.end();
434 cont.nextProbe = cont.numProbes;
435 return found;
436}
437
438pos_t Hashjoin::joinSelParallel() {
439 size_t found = 0;

Callers

nothing calls this directly

Calls 2

find_chain_taggedMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected