Changeset: 643cccc101b7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/643cccc101b7
Modified Files:
        sql/backends/monet5/rel_bin.c
Branch: default
Log Message:

small perf optimization, ie only lookup function when needed


diffs (21 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -4380,7 +4380,7 @@ sql_insert_check_null(backend *be, sql_t
 {
        mvc *sql = be->mvc;
        node *m, *n;
-       sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true);
+       sql_subfunc *cnt = NULL;
 
        for (n = ol_first_node(t->columns), m = inserts->h; n && m;
                n = n->next, m = m->next) {
@@ -4393,6 +4393,8 @@ sql_insert_check_null(backend *be, sql_t
 
                        if (!(s->key && s->nrcols == 0)) {
                                s = stmt_selectnil(be, column(be, i));
+                               if (!cnt)
+                                       cnt = sql_bind_func(sql, "sys", 
"count", sql_bind_localtype("void"), NULL, F_AGGR, true);
                                s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
                        } else {
                                sql_subfunc *isnil = sql_bind_func(sql, "sys", 
"isnull", &c->type, NULL, F_FUNC, true);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to