Changeset: aa01a2e99194 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aa01a2e99194
Modified Files:
        gdk/gdk_join.c
Branch: Oct2020
Log Message:

Handle join with candidate list with exception in mergejoin.


diffs (26 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3875,16 +3875,18 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
         * of doing searches on r, we swap */
        swap = (lcost < rcost);
 
-       if ((BATordered(r) || BATordered_rev(r)) &&
-           (lci.ncand * (log2((double) rci.ncand) + 1) < (swap ? lcost : 
rcost))) {
+       if ((r->ttype == TYPE_void && r->tvheap != NULL) ||
+           ((BATordered(r) || BATordered_rev(r)) &&
+            (lci.ncand * (log2((double) rci.ncand) + 1) < (swap ? lcost : 
rcost)))) {
                /* r is sorted and it is cheaper to do multiple binary
                 * searches than it is to use a hash */
                return mergejoin(r1p, r2p, l, r, &lci, &rci,
                                 nil_matches, false, false, false, false, false,
                                 estimate, t0, false, __func__);
        }
-       if ((BATordered(l) || BATordered_rev(l)) &&
-           (rci.ncand * (log2((double) lci.ncand) + 1) < (swap ? lcost : 
rcost))) {
+       if ((l->ttype == TYPE_void && l->tvheap != NULL) ||
+           ((BATordered(l) || BATordered_rev(l)) &&
+            (rci.ncand * (log2((double) lci.ncand) + 1) < (swap ? lcost : 
rcost)))) {
                /* l is sorted and it is cheaper to do multiple binary
                 * searches than it is to use a hash */
                rc = mergejoin(r2p ? r2p : &r2, r1p, r, l, &rci, &lci,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to