Changeset: 00bd1e92e820 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/00bd1e92e820
Modified Files:
        monetdb5/optimizer/opt_for.c
        monetdb5/optimizer/opt_mergetable.c
        sql/benchmarks/tpch/Tests/one.test.in
Branch: default
Log Message:

fixed mergetable issue with for compression.
enabled small usage test of 'for' in tpch.


diffs (67 lines):

diff --git a/monetdb5/optimizer/opt_for.c b/monetdb5/optimizer/opt_for.c
--- a/monetdb5/optimizer/opt_for.c
+++ b/monetdb5/optimizer/opt_for.c
@@ -108,6 +108,16 @@ OPTforImplementation(Client cntxt, MalBl
                                        freeInstruction(p);
                                        done = 1;
                                        break;
+                               } else if (getModuleId(p) == batRef && 
getFunctionId(p) == mirrorRef) {
+                                       /* id = mirror(col) with col = 
for.decompress(o,min_val)
+                                        * id = mirror(o) */
+                                       InstrPtr r = copyInstruction(p);
+                                       getArg(r, j) = varisfor[k];
+                                       pushInstruction(mb,r);
+                                       freeInstruction(p);
+                                       done = 1;
+                                       break;
+                               } else if (isSelect(p)) {
                                } else// if (isSelect(p)) {
                                        if (getFunctionId(p) == thetaselectRef) 
{
                                                /* pos = thetaselect(col, cand, 
l, ...) with col = for.decompress(o, minval)
@@ -242,7 +252,7 @@ OPTforImplementation(Client cntxt, MalBl
 
        for(; i<slimit; i++)
                if (old[i])
-                       pushInstruction(mb, old[i]);
+                       freeInstruction(old[i]);
        /* Defense line against incorrect plans */
        if (actions > 0){
                msg = chkTypes(cntxt->usermodule, mb, FALSE);
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -2249,7 +2249,7 @@ OPTmergetableImplementation(Client cntxt
                if (match > 0 &&
                                ((getModuleId(p) == algebraRef &&
                        getFunctionId(p) == projectionRef) ||
-                               (getModuleId(p) == dictRef &&
+                               ((getModuleId(p) == dictRef || getModuleId(p) 
== forRef) &&
                        getFunctionId(p) == decompressRef)) &&
                   (m=is_a_mat(getArg(p,1), &ml)) >= 0) {
                        n=is_a_mat(getArg(p,2), &ml);
diff --git a/sql/benchmarks/tpch/Tests/one.test.in 
b/sql/benchmarks/tpch/Tests/one.test.in
--- a/sql/benchmarks/tpch/Tests/one.test.in
+++ b/sql/benchmarks/tpch/Tests/one.test.in
@@ -203,6 +203,9 @@ statement ok
 create procedure sys.dict_compress( sname string, tname string, cname string, 
ordered_values bool) external name dict.compress;
 
 statement ok
+create procedure sys.for_compress( sname string, tname string, cname string) 
external name "for".compress;
+
+statement ok
 call dict_compress('sys', 'region', 'r_regionkey', true);
 
 statement ok
@@ -265,8 +268,11 @@ call dict_compress('sys', 'lineitem', 'l
 statement ok
 call dict_compress('sys', 'lineitem', 'l_discount', true);
 
+# testing l_tax now with for compression.
+# not dict call dict_compress('sys', 'lineitem', 'l_tax', true);
+# 
 statement ok
-call dict_compress('sys', 'lineitem', 'l_tax', true);
+call for_compress('sys', 'lineitem', 'l_tax');
 
 statement ok
 call dict_compress('sys', 'lineitem', 'l_returnflag', true);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to