Changeset: c580d594889f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c580d594889f
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        gdk/ChangeLog
        gdk/gdk.h
        gdk/gdk_join_legacy.c
        monetdb5/ChangeLog
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/algebra.h
        monetdb5/modules/kernel/algebra.mal
        monetdb5/modules/mal/joinpath.c
        monetdb5/optimizer/Tests/All
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_joinpath.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_reorder.c
        monetdb5/optimizer/optimizer.mal
Branch: default
Log Message:

Removed algebra.leftjoin, algebra.leftjoinPath, and BATleftjoin.


diffs (truncated from 533 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -2332,10 +2332,6 @@ pattern algebra.leftfetchjoinPath(l:bat[
 address ALGjoinPath;
 comment Routine to handle join paths.  The type analysis is rather tricky.
 
-pattern algebra.leftjoinPath(l:bat[:oid,:any]...):bat[:oid,:any] 
-address ALGjoinPath;
-comment Routine to handle join paths.  The type analysis is rather tricky.
-
 command 
algebra.likesubjoin(l:bat[:oid,:str],r:bat[:oid,:str],sl:bat[:oid,:oid],sr:bat[:oid,:oid],nil_matches:bit,estimate:lng)
 (X_7:bat[:oid,:oid],X_8:bat[:oid,:oid]) 
 address LIKEsubjoin1;
 command 
algebra.likesubjoin(l:bat[:oid,:str],r:bat[:oid,:str],esc:str,sl:bat[:oid,:oid],sr:bat[:oid,:oid],nil_matches:bit,estimate:lng)
 (X_8:bat[:oid,:oid],X_9:bat[:oid,:oid]) 
@@ -2362,10 +2358,6 @@ command algebra.leftfetchjoin(left:bat[:
 address ALGleftfetchjoin;
 comment Hook directly into the left fetch join implementation.
 
-command 
algebra.leftjoin(left:bat[:oid,:any_2],right:bat[:any_2,:any_3],estimate:lng):bat[:oid,:any_3]
 
-address ALGleftjoinestimate;
-command 
algebra.leftjoin(left:bat[:oid,:any_2],right:bat[:any_2,:any_3]):bat[:oid,:any_3]
 
-address ALGleftjoin;
 command algebra.not_ilike(s:str,pat:str):bit 
 address PCREnotilike2;
 command algebra.not_ilike(s:str,pat:str,esc:str):bit 
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -2843,10 +2843,6 @@ pattern algebra.leftfetchjoinPath(l:bat[
 address ALGjoinPath;
 comment Routine to handle join paths.  The type analysis is rather tricky.
 
-pattern algebra.leftjoinPath(l:bat[:oid,:any]...):bat[:oid,:any] 
-address ALGjoinPath;
-comment Routine to handle join paths.  The type analysis is rather tricky.
-
 command 
algebra.likesubjoin(l:bat[:oid,:str],r:bat[:oid,:str],sl:bat[:oid,:oid],sr:bat[:oid,:oid],nil_matches:bit,estimate:lng)
 (X_7:bat[:oid,:oid],X_8:bat[:oid,:oid]) 
 address LIKEsubjoin1;
 command 
algebra.likesubjoin(l:bat[:oid,:str],r:bat[:oid,:str],esc:str,sl:bat[:oid,:oid],sr:bat[:oid,:oid],nil_matches:bit,estimate:lng)
 (X_8:bat[:oid,:oid],X_9:bat[:oid,:oid]) 
@@ -2873,10 +2869,6 @@ command algebra.leftfetchjoin(left:bat[:
 address ALGleftfetchjoin;
 comment Hook directly into the left fetch join implementation.
 
-command 
algebra.leftjoin(left:bat[:oid,:any_2],right:bat[:any_2,:any_3],estimate:lng):bat[:oid,:any_3]
 
-address ALGleftjoinestimate;
-command 
algebra.leftjoin(left:bat[:oid,:any_2],right:bat[:any_2,:any_3]):bat[:oid,:any_3]
 
-address ALGleftjoin;
 command algebra.not_ilike(s:str,pat:str):bit 
 address PCREnotilike2;
 command algebra.not_ilike(s:str,pat:str,esc:str):bit 
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -139,7 +139,6 @@ gdk_return BATins(BAT *b, BAT *c, bit fo
 BAT *BATintersectcand(BAT *a, BAT *b);
 BAT *BATjoin(BAT *l, BAT *r, BUN estimate);
 gdk_return BATkey(BAT *b, int onoff);
-BAT *BATleftjoin(BAT *l, BAT *r, BUN estimate);
 BAT *BATmark(BAT *b, oid base);
 BAT *BATmark_grp(BAT *b, BAT *g, const oid *base);
 void *BATmax(BAT *b, void *aggr);
@@ -718,8 +717,6 @@ str ALGgroupby(bat *res, const bat *gids
 str ALGjoin2(bat *l, bat *r, const bat *lid, const bat *rid);
 str ALGjoinPath(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ALGleftfetchjoin(bat *result, const bat *lid, const bat *rid);
-str ALGleftjoin(bat *result, const bat *lid, const bat *rid);
-str ALGleftjoinestimate(bat *result, const bat *lid, const bat *rid, const lng 
*estimate);
 str ALGlike(bat *ret, const bat *bid, const str *k);
 str ALGmaxany(ptr result, const bat *bid);
 str ALGminany(ptr result, const bat *bid);
@@ -2265,8 +2262,6 @@ int keepProp;
 str languageRef;
 str leftfetchjoinPathRef;
 str leftfetchjoinRef;
-str leftjoinPathRef;
-str leftjoinRef;
 str levenshtein_impl(int *result, str *s, str *t, int *insdel_cost, int 
*replace_cost, int *transpose_cost);
 str levenshteinbasic2_impl(int *result, str *s, str *t);
 str levenshteinbasic_impl(int *result, str *s, str *t);
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -2,6 +2,7 @@
 # This file is updated with Maddlog
 
 * Wed Sep 16 2015 Sjoerd Mullender <[email protected]>
+- Removed BATleftjoin.  Use BATsubleftjoin or BATproject instead.
 - Removed BATleftfetchjoin.  Use BATproject instead.
 - Removed BUNins from the list of exported functions.
 
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3118,7 +3118,6 @@ gdk_export BAT *BATconstant(int tt, cons
 gdk_export BAT *BATconst(BAT *l, int tt, const void *val, int role);
 gdk_export BAT *BATsemijoin(BAT *l, BAT *r);
 gdk_export BAT *BATjoin(BAT *l, BAT *r, BUN estimate);
-gdk_export BAT *BATleftjoin(BAT *l, BAT *r, BUN estimate);
 gdk_export gdk_return BATcross1(BAT **r1p, BAT **r2p, BAT *l, BAT *r);
 gdk_export gdk_return BATsubcross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT 
*sl, BAT *sr);
 
@@ -3214,17 +3213,6 @@ gdk_export BAT *BATsample(BAT *b, BUN n)
                BATjoin(_l, _r, (estimate));                            \
        })
 
-#define BATleftjoin(l, r, estimate)                                    \
-       ({                                                              \
-               BAT *_l = (l), *_r = (r);                               \
-               HEADLESSDEBUG fprintf(stderr,                           \
-                       "#BATleftjoin([%s,%s]#"BUNFMT",[%s,%s]#"BUNFMT") 
%s[%s:%d]\n", \
-                       _COL_TYPE(_l->H), _COL_TYPE(_l->T), BATcount(_l), \
-                       _COL_TYPE(_r->H), _COL_TYPE(_r->T), BATcount(_r), \
-                       __func__, __FILE__, __LINE__);                  \
-               BATleftjoin(_l, _r, (estimate));                        \
-       })
-
 #endif
 #endif
 
diff --git a/gdk/gdk_join_legacy.c b/gdk/gdk_join_legacy.c
--- a/gdk/gdk_join_legacy.c
+++ b/gdk/gdk_join_legacy.c
@@ -14,7 +14,6 @@
 
 #undef BATsemijoin
 #undef BATjoin
-#undef BATleftjoin
 
 /* Return a subset of l where head elements occur as head element in r. */
 BAT *
@@ -188,12 +187,3 @@ BATjoin(BAT *l, BAT *r, BUN estimate)
        return do_batjoin(l, r, estimate,
                          BATsubjoin, "BATjoin");
 }
-
-/* join [any_1,any_2] with [any_2,any_3], return [any_1,any_3];
- * return value is in order of left input */
-BAT *
-BATleftjoin(BAT *l, BAT *r, BUN estimate)
-{
-       return do_batjoin(l, r, estimate,
-                         BATsubleftjoin, "BATleftjoin");
-}
diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog
--- a/monetdb5/ChangeLog
+++ b/monetdb5/ChangeLog
@@ -2,6 +2,8 @@
 # This file is updated with Maddlog
 
 * Wed Sep 16 2015 Sjoerd Mullender <[email protected]>
+- Removed algebra.leftjoin.  Use algebra.subleftjoin or
+  algebra.leftfetchjoin instead.
 - Removed algebra.tdiff and algebra.tinter.
 
 * Mon Sep 14 2015 Sjoerd Mullender <[email protected]>
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -689,31 +689,6 @@ ALGbinary(bat *result, const bat *lid, c
        return MAL_SUCCEED;
 }
 
-static str
-ALGbinaryestimate(bat *result, const bat *lid, const bat *rid, const lng 
*estimate,
-                                 BAT *(*func)(BAT *, BAT *, BUN), const char 
*name)
-{
-       BAT *left, *right, *bn = NULL;
-
-       if ((left = BATdescriptor(*lid)) == NULL) {
-               throw(MAL, name, RUNTIME_OBJECT_MISSING);
-       }
-       if ((right = BATdescriptor(*rid)) == NULL) {
-               BBPunfix(left->batCacheid);
-               throw(MAL, name, RUNTIME_OBJECT_MISSING);
-       }
-       bn = (*func)(left, right, estimate ? (BUN) *estimate : BUN_NONE);
-       BBPunfix(left->batCacheid);
-       BBPunfix(right->batCacheid);
-       if (bn == NULL)
-               throw(MAL, name, GDK_EXCEPTION);
-       if (!(bn->batDirty&2))
-               BATsetaccess(bn, BAT_READ);
-       *result = bn->batCacheid;
-       BBPkeepref(*result);
-       return MAL_SUCCEED;
-}
-
 static BAT *
 BATwcopy(BAT *b)
 {
@@ -871,18 +846,6 @@ ALGrangejoin2(bat *l, bat *r, const bat 
 }
 
 str
-ALGleftjoinestimate(bat *result, const bat *lid, const bat *rid, const lng 
*estimate)
-{
-       return ALGbinaryestimate(result, lid, rid, estimate, BATleftjoin, 
"algebra.leftjoin");
-}
-
-str
-ALGleftjoin(bat *result, const bat *lid, const bat *rid)
-{
-       return ALGbinaryestimate(result, lid, rid, NULL, BATleftjoin, 
"algebra.leftjoin");
-}
-
-str
 ALGleftfetchjoin(bat *result, const bat *lid, const bat *rid)
 {
        return ALGbinary(result, lid, rid, BATproject, "algebra.leftfetchjoin");
diff --git a/monetdb5/modules/kernel/algebra.h 
b/monetdb5/modules/kernel/algebra.h
--- a/monetdb5/modules/kernel/algebra.h
+++ b/monetdb5/modules/kernel/algebra.h
@@ -59,8 +59,6 @@ algebra_export str ALGfirstn(Client cntx
 algebra_export str ALGcopy(bat *result, const bat *bid);
 algebra_export str ALGsubunique2(bat *result, const bat *bid, const bat *sid);
 algebra_export str ALGsubunique1(bat *result, const bat *bid);
-algebra_export str ALGleftjoinestimate(bat *result, const bat *lid, const bat 
*rid, const lng *estimate);
-algebra_export str ALGleftjoin(bat *result, const bat *lid, const bat *rid);
 algebra_export str ALGleftfetchjoin(bat *result, const bat *lid, const bat 
*rid);
 algebra_export str ALGsemijoin(bat *result, const bat *lid, const bat *rid);
 algebra_export str ALGtinter(bat *result, const bat *lid, const bat *rid);
diff --git a/monetdb5/modules/kernel/algebra.mal 
b/monetdb5/modules/kernel/algebra.mal
--- a/monetdb5/modules/kernel/algebra.mal
+++ b/monetdb5/modules/kernel/algebra.mal
@@ -13,11 +13,6 @@ command groupby(gids:bat[:oid,:oid], cnt
 address ALGgroupby
 comment "Produces a new BAT with groups identified by the head column. The 
result contains tail times the head value, ie the tail contains the result 
group sizes.";
 
-command leftjoin( left:bat[:oid,:any_2], right:bat[:any_2,:any_3]) 
:bat[:oid,:any_3]
-address ALGleftjoin;
-command leftjoin( left:bat[:oid,:any_2], right:bat[:any_2,:any_3], 
estimate:lng) :bat[:oid,:any_3]
-address ALGleftjoinestimate;
-
 #END OF HEADLESS PLANS
 
 command find(b:bat[:oid,:any_1], t:any_1):oid
diff --git a/monetdb5/modules/mal/joinpath.c b/monetdb5/modules/mal/joinpath.c
--- a/monetdb5/modules/mal/joinpath.c
+++ b/monetdb5/modules/mal/joinpath.c
@@ -43,12 +43,11 @@
 #define SMALL_OPERAND  1024
 
 static BUN
-ALGjoinCost(Client cntxt, BAT *l, BAT *r, int flag)
+ALGjoinCost(Client cntxt, BAT *l, BAT *r)
 {
        BUN lc, rc;
        BUN cost=0;
 
-       (void) flag;
        (void) cntxt;
        lc = BATcount(l);
        rc = BATcount(r);
@@ -77,7 +76,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
                /* orderedfetchjoin > sequential access */
                cost /= 6;
        else
-       if (BATtdense(l) && BAThordered(r) && flag != 0 /* no leftjoin */)
+       if (BATtdense(l) && BAThordered(r))
                /* (reversed-) orderedfetchjoin -> sequential access */
                cost /= 6;
        else
@@ -85,7 +84,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
                /* fetchjoin with random access in L1 */
                cost /= 5;
        else
-       if (BATtdense(l) && lc <= SMALL_OPERAND && flag != 0 /* no leftjoin */)
+       if (BATtdense(l) && lc <= SMALL_OPERAND)
                /* (reversed-) fetchjoin with random access in L1 */
                cost /= 5;
        else
@@ -97,7 +96,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
                /* binary-lookup-join with random access in L1 */
                cost /= 3;
        else
-       if (BATtordered(l) && lc <= SMALL_OPERAND && flag != 0 /* no leftjoin 
*/)
+       if (BATtordered(l) && lc <= SMALL_OPERAND)
                /* (reversed-) binary-lookup-join with random access in L1 */
                cost /= 3;
        else
@@ -109,7 +108,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
                /* hashjoin with hashtable in L1 */
                cost /= 3;
        else
-       if (lc <= SMALL_OPERAND && flag != 0 /* no leftjoin */)
+       if (lc <= SMALL_OPERAND)
                /* (reversed-) hashjoin with hashtable in L1 */
                cost /= 3;
        else
@@ -117,7 +116,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
                /* fetchjoin with random access beyond L1 */
                cost /= 2;
        else
-       if (BATtdense(l) && flag != 0 /* no leftjoin */)
+       if (BATtdense(l))
                /* (reversed-) fetchjoin with random access beyond L1 */
                cost /= 2;
        else
@@ -132,7 +131,7 @@ ALGjoinCost(Client cntxt, BAT *l, BAT *r
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to