Changeset: 6f69cf3fd59f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6f69cf3fd59f
Modified Files:
documentation/source/pipeline_join.rst
sql/backends/monet5/rel_pphash.c
Branch: default
Log Message:
small clean up
diffs (84 lines):
diff --git a/documentation/source/pipeline_join.rst
b/documentation/source/pipeline_join.rst
--- a/documentation/source/pipeline_join.rst
+++ b/documentation/source/pipeline_join.rst
@@ -19,8 +19,9 @@ Players
list_length(rel->attr) == 1: group mark join
|-> atom(TRUE): IN, EXISTS
|-> atom(FALSE): NOT IN, NOT EXISTS
- rel->exps: join and select exps
- rel->{l,r}->exps: projections exps, from rel->l to rel->r
+ rel->exps: join and selection exps
+ rel->{l,r}->exps: projections exps of {left, right}-hand side
+ rel->{l,r}->attr: join exps of {left, right}-hand side
rel->single:
rel->any:
rel->sematics:
@@ -84,8 +85,8 @@ Implementation
* Output unmatched LHS (i.e. excl. NILs)
* ``oahash.nprobe``: single column antijoin
* multicolumn antijoin:
- * with prb-side NULLs: single-column hash-table, multicolumn probe
- * without NULLs: inner-probe + select FALSE
+ * without NULLs: inner-probe + diff
+ * with NULLs: first-column hash-table, probe payloads
* Single join
* TODO: which queries use single join?
diff --git a/sql/backends/monet5/rel_pphash.c b/sql/backends/monet5/rel_pphash.c
--- a/sql/backends/monet5/rel_pphash.c
+++ b/sql/backends/monet5/rel_pphash.c
@@ -130,10 +130,8 @@ oahash_slicer(backend *be, stmt *sub)
/* Generates the parallel block to probe the hash table
*/
static stmt *
-oahash_probe(backend *be, sql_rel *rel, list *jexps, list *exps_cmp_prb, const
stmt *stmts_ht, stmt *sub, bool anti, bool outer, bool groupjoin, bool
has_outerselect, stmt **nulls, stmt **prb_mrk)
+oahash_probe(backend *be, sql_rel *rel, list *jexps, list *exps_cmp_prb, const
stmt *stmts_ht, stmt *sub, bool anti, bool groupjoin, bool has_outerselect,
stmt **nulls, stmt **prb_mrk)
{
- (void) outer;
-
stmt *prb_res = NULL, *outerm = NULL;
bool has_leftouter = (rel->op == op_left || rel->op == op_full /*||
(rel->op == op_right && rel->oahash == 1)*/);
@@ -151,7 +149,6 @@ oahash_probe(backend *be, sql_rel *rel,
prb_res = stmt_oahash_probe(be, key, prb_res, m->data,
stmts_ht->op3, outerm, single, e2->semantics, eq, has_leftouter, grpjoin);
if (prb_res == NULL) return NULL;
- //if (outer || grpjoin) {
if (has_leftouter || grpjoin) {
assert (prb_res->q->retc >= 2);
outerm = stmt_blackbox_result(be, prb_res->q, 2,
sql_fetch_localtype(TYPE_bit));
@@ -160,7 +157,6 @@ oahash_probe(backend *be, sql_rel *rel,
if (nulls && stmt_has_null(key) && is_any(e2))
*nulls = stmt_selectnil(be, key, *nulls);
}
- //if ((outer || groupjoin) && outerm)
if ((has_leftouter || groupjoin) && outerm)
*prb_mrk = outerm;
/* probe of last column is the final res */
@@ -416,8 +412,7 @@ rel2bin_oahash_equi_join(backend *be, sq
if (probe_sub)
*probe_sub = sub;
- bit outer = is_outerjoin(rel->op);
- stmt *prb_res = oahash_probe(be, rel, jexps, exps_cmp_prb, stmts_ht,
sub, false, outer, mark, has_outerselect, nulls, prb_mrk);
+ stmt *prb_res = oahash_probe(be, rel, jexps, exps_cmp_prb, stmts_ht,
sub, false /*anti*/, mark/*groupjoin*/, has_outerselect, nulls, prb_mrk);
if (prb_res == NULL) return NULL;
/*** PROJECT RESULT PHASE ***/
@@ -425,6 +420,7 @@ rel2bin_oahash_equi_join(backend *be, sq
list *lp = oahash_project_prb(be, exps_prj_prb, prb_res, stmts_ht->op3,
leftouter, sub, probed_rowids);
list *lh = oahash_project_hsh(be, exps_prj_hsh, stmts_ht, prb_res,
leftouter, hsh_mrk);
+ bit outer = is_outerjoin(rel->op);
/* !exps_prj_hsh => !shared_hp => mark the last hash-column instead of
a payload column */
if (outer && hsh_mrk && !*hsh_mrk) {
assert(list_empty(exps_prj_hsh));
@@ -1340,7 +1336,7 @@ rel2bin_oahash_semi(backend *be, sql_rel
probe_sub = sub = _start_pp(be, rel_prb->l, false, refs, NULL);
if (!sub) return NULL;
- stmt *prb_res = oahash_probe(be, rel, rel->exps, exps_cmp_prb,
stmts_ht, sub, anti, false, false, !list_empty(sexps), &nulls, NULL);
+ stmt *prb_res = oahash_probe(be, rel, rel->exps, exps_cmp_prb,
stmts_ht, sub, anti, false/*groupjoin*/, !list_empty(sexps)/*has_outerselect*/,
&nulls, NULL);
if (prb_res == NULL) return NULL;
/*** PROJECT RESULT PHASE ***/
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]