Changeset: cdc0a87d38b1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cdc0a87d38b1 Modified Files: MonetDB5/src/optimizer/opt_mergetable.mx MonetDB5/src/optimizer/opt_prelude.mx MonetDB5/src/optimizer/opt_support.mx Branch: Jun2010 Log Message:
fixing more problems with mergetable sort (order based topn) currently cannot be handled by mergetable a 2 phase solution like the current group/aggr code is needed. Also a need for pqueue.topn_min/max -> mat.topn_min/max is needed. join(x,y,z) operators aren't supported yet. diffs (118 lines): diff -r fe2c827daceb -r cdc0a87d38b1 MonetDB5/src/optimizer/opt_mergetable.mx --- a/MonetDB5/src/optimizer/opt_mergetable.mx Tue Aug 17 11:34:31 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_mergetable.mx Tue Aug 17 14:21:31 2010 +0200 @@ -766,7 +766,6 @@ return mtop; } - /* join, also handles the case that mat[m].mm is set, ie that we have the extend available. */ @@ -1607,7 +1606,11 @@ @c /* only handle simple joins, ie not range/band joins */ - if (match > 0 && match <= 2 && isMatJoinOp(p)) { + /* For range/band joins (argc == 4), the propagation of oids + is different, ie result-head equals head-1st arg, + result-tail equals head-2nd/3rd arg */ + + if (match > 0 && match <= 2 && isMatJoinOp(p) && p->argc == 3) { m = isMATalias(getArg(p,1), mat, mtop); n = isMATalias(getArg(p,2), mat, mtop); if ((m = mat_join(mb, p, mat, mtop, m, n)) < 0) @@ -1731,9 +1734,16 @@ getModuleId(p) == aggrRef || (getModuleId(p) == algebraRef && (getFunctionId(p) == sortTailRef || - getFunctionId(p) == sortReverseTailRef)))) { + getFunctionId(p) == sortReverseTailRef)) || + (getModuleId(p) == pqueueRef && + (getFunctionId(p) == topn_minRef || + getFunctionId(p) == topn_maxRef)))) { error++; goto fail; + /* For order (and order related topn) + we need a similar 2 phase model as used for group + by + */ } @- The slice operation can also be piggy backed onto the mat.pack using it diff -r fe2c827daceb -r cdc0a87d38b1 MonetDB5/src/optimizer/opt_prelude.mx --- a/MonetDB5/src/optimizer/opt_prelude.mx Tue Aug 17 11:34:31 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_prelude.mx Tue Aug 17 14:21:31 2010 +0200 @@ -127,7 +127,7 @@ opt_export str newRef; opt_export str oidRef; opt_export str octopusRef; -opt_export str openRef; +opt_export str openRef; opt_export str optimizerRef; opt_export str packRef; opt_export str pack2Ref; @@ -140,6 +140,7 @@ opt_export str preludeRef; opt_export str prodRef; opt_export str postludeRef; +opt_export str pqueueRef; opt_export str profilerRef; opt_export str projectRef; opt_export str putRef; @@ -180,6 +181,8 @@ opt_export str sumRef; opt_export str sunionRef; opt_export str takeRef; +opt_export str topn_minRef; +opt_export str topn_maxRef; opt_export str tuniqueRef; opt_export str not_uniqueRef; opt_export str unionRef; @@ -337,6 +340,7 @@ str preludeRef; str prodRef; str postludeRef; +str pqueueRef; str profilerRef; str projectRef; str putRef; @@ -377,6 +381,8 @@ str sumRef; str sunionRef; str takeRef; +str topn_minRef; +str topn_maxRef; str tuniqueRef; str not_uniqueRef; str unionRef; @@ -531,6 +537,7 @@ prodRef = putName("product",7); profilerRef = putName("profiler",8); postludeRef = putName("postlude",8); + pqueueRef = putName("pqueue",6); projectRef = putName("project",7); putRef = putName("put",3); queryRef = putName("query",5); @@ -570,6 +577,8 @@ sumRef = putName("sum",3); sunionRef= putName("sunion",6); takeRef= putName("take",5); + topn_minRef= putName("topn_min",8); + topn_maxRef= putName("topn_max",8); tuniqueRef = putName("tunique",7); not_uniqueRef= putName("not_unique",10); unionRef= putName("union",5); diff -r fe2c827daceb -r cdc0a87d38b1 MonetDB5/src/optimizer/opt_support.mx --- a/MonetDB5/src/optimizer/opt_support.mx Tue Aug 17 11:34:31 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_support.mx Tue Aug 17 14:21:31 2010 +0200 @@ -1263,7 +1263,8 @@ // getFunctionId(p) == antijoinRef || is not mat save getFunctionId(p) == leftjoinRef || getFunctionId(p) == thetajoinRef || - getFunctionId(p) == bandjoinRef)); + getFunctionId(p) == bandjoinRef) + ); } int isFragmentGroup(InstrPtr p){ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list