Changeset: 2333dda76eb0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2333dda76eb0
Modified Files:
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql.h
        sql/server/rel_planner.c
Branch: default
Log Message:

use dbl for cost(s)


diffs (58 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3149,16 +3149,10 @@ not_unique_oids(bat *ret, const bat *bid
 
 /* row case */
 str
-SQLidentity(bat *ret, const bat *bid)
+SQLidentity(oid *ret, const void *i)
 {
-       BAT *bn, *b;
-
-       if ((b = BATdescriptor(*bid)) == NULL) {
-               throw(SQL, "batcalc.identity", "Cannot access descriptor");
-       }
-       bn = VIEWhead(b);
-       BBPunfix(b->batCacheid);
-       BBPkeepref(*ret = bn->batCacheid);
+       (void)i;
+       *ret = 0;
        return MAL_SUCCEED;
 }
 
diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -160,7 +160,7 @@ sql5_export str sql_rank_grp(bat *rid, c
 sql5_export str sql_rank(bat *rid, const bat *bid);
 sql5_export str sql_dense_rank_grp(bat *rid, const bat *bid, const bat *gid, 
const bat *gpe);
 sql5_export str sql_dense_rank(bat *rid, const bat *bid);
-sql5_export str SQLidentity(bat *rid, const bat *bid);
+sql5_export str SQLidentity(oid *rid, const void *i);
 sql5_export str BATSQLidentity(bat *rid, const bat *bid);
 sql5_export str PBATSQLidentity(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
diff --git a/sql/server/rel_planner.c b/sql/server/rel_planner.c
--- a/sql/server/rel_planner.c
+++ b/sql/server/rel_planner.c
@@ -807,8 +807,8 @@ memo_compute_cost(list *memo)
                memoitem *mi = n->data;
 
                if (mi->joins) {
-                       lng cnt = 0, cost = 0;
-                       lng width = 1;
+                       lng cnt = 0, width = 1;
+                       dbl cost = 0;
 
                        /* cost minimum of join costs */
                        for ( m = mi->joins->h; m; m = m->next ) {
@@ -817,7 +817,7 @@ memo_compute_cost(list *memo)
                                lng mincnt = MIN(mj->l->count, mj->r->count);
                                dbl nsel = mj->sel;
                                lng ocnt = MAX((lng) (mincnt*nsel), 1);
-                               lng ncost = 0;
+                               dbl ncost = 0;
 
                                /* mincnt*mincnt_size_width*hash_const_cost + 
mincnt * output_width(for now just sum of width) * memaccess const */
                                /* current consts are 1 and 1 */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to