Changeset: 30cf98fb8973 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=30cf98fb8973
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_statement.c
Branch: Jun2020
Log Message:

reduce use of mirror (should allow more mal optimizers too function)


diffs (41 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
@@ -316,6 +316,17 @@ stmt_selectnonil( backend *be, stmt *col
        return nn;
 }
 
+static int
+is_tid_chain(stmt *cand) 
+{
+       while(cand && cand->type != st_tid && cand->cand) {
+               cand = cand->cand;
+       }
+       if (cand && cand->type == st_tid)
+               return 1;
+       return 0;
+}
+
 static stmt *
 subrel_project( backend *be, stmt *s, list *refs, sql_rel *rel)
 {
@@ -332,7 +343,7 @@ subrel_project( backend *be, stmt *s, li
                assert(c->type == st_alias || (c->type == st_join && c->flag == 
cmp_project) || c->type == st_bat || c->type == st_idxbat || c->type == 
st_single);
                if (c->type != st_alias) {
                        c = stmt_project(be, cand, c);
-               } else if (c->op1->type == st_mirror && cand->type == st_tid) { 
/* alias with mirror (ie full row ids) */
+               } else if (c->op1->type == st_mirror && is_tid_chain(cand)) { 
/* alias with mirror (ie full row ids) */
                        c = stmt_alias(be, cand, c->tname, c->cname); 
                } else { /* st_alias */
                        stmt *s = c->op1;
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -3315,6 +3315,7 @@ tail_type(stmt *st)
                case st_tunion:
                case st_tdiff:
                case st_tinter:
+                       return sql_bind_localtype("oid");
                case st_append:
                case st_alias:
                case st_gen_group:
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to