Re: MonetDB: default - Reserve border space

2010-08-05 Thread Stefan Manegold

Just for info, here are the simplified terms to facilitate before & after
comparison.

Stefan

On Thu, Aug 05, 2010 at 08:16:55AM +0200, martin.kers...@cwi.nl wrote:
> Changeset: ffcd6ef3b2dd for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffcd6ef3b2dd
> Modified Files:
>   clients/src/mapiclient/mclient.mx
> Branch: default
> Log Message:
> 
> Reserve border space
> The pagewidth should be less to accomodate borders to be drawn.
> 
> 
> diffs (23 lines):
> 
> diff -r 2ba10c414f4c -r ffcd6ef3b2dd clients/src/mapiclient/mclient.mx
> --- a/clients/src/mapiclient/mclient.mx   Thu Jul 22 10:27:14 2010 +0200
> +++ b/clients/src/mapiclient/mclient.mx   Tue Aug 03 06:59:10 2010 +0200
> @@ -1055,8 +1055,8 @@
>  available space (+1 so we
>  always fully fill the
>  terminal) */
> - len[i] = 1 + (pagewidth - 2 - ((fields 
> * 3) - 1)) / fields;

==  len[i] = 1 + (pagewidth - 1 - (fields * 
3)) / fields;
==  len[i] = 1 + (pagewidth - 1) / fields - 
3;

==  len[i] = (pagewidth - 1) / fields - 2;

==  len[i] = (ws.ws_col - 1) / fields - 2;

> - }
> + len[i] =  (pagewidth - ((fields * 3) - 
> 3)) / fields;

==  len[i] =  (pagewidth + 3) / fields - 3;

==  len[i] =  (ws.ws_col - 10 + 3) / fields 
- 3;

==  len[i] =  (ws.ws_col - 7) / fields - 3;

> + } 
>   if (len[i] < MINCOLSIZE)
>   len[i] = MINCOLSIZE;
>   s = mapi_get_name(hdl, i);
> @@ -1256,7 +1256,7 @@
>   struct winsize ws;
>  
>   if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0 && ws.ws_col > 0)
> - pagewidth = ws.ws_col;
> + pagewidth = ws.ws_col - 10;  /* reserve some space for 
> sliders et al */
>   else
>  #endif
>   pagewidth = DEFWIDTH;
> ___
> Checkin-list mailing list
> Checkin-list@monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list

-- 
| Dr. Stefan Manegold | mailto:stefan.maneg...@cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212   |
| The Netherlands | Fax : +31 (20) 592-4199   |
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


Re: MonetDB: default - Reserve border space

2010-08-05 Thread Fabian Groffen
On 05-08-2010 09:18:51 +0200, Stefan Manegold wrote:
> Just for info, here are the simplified terms to facilitate before & after
> comparison.

before:

sql>select NULL;
+--+
| single_value |
+==+
| null |
+--+
1 tuple (0.668ms)
sql>select NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL;
++-+-+-+-+-+-+-+
| single | single_ | single_ | single_ | single_ | single_ | single_ | single_ |
: _value : value   : value   : value   : value   : value   : value   : value   :
++=+=+=+=+=+=+=+
| null   | null| null| null| null| null| null| null|
++-+-+-+-+-+-+-+
1 tuple (1.065ms)

after:

sql>select NULL;
++
| single_value   |
++
| null   |
++
1 tuple (0.656ms)
sql>select NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL;
+---+---+---++++++
| singl | singl | singl | single | single | single | single | single |
: e_val : e_val : e_val : _value : _value : _value : _value : _value :
: ue: ue: ue::::::
+===+===+===++++++
| null  | null  | null  | null   | null   | null   | null   | null   |
+---+---+---++++++
1 tuple (1.086ms)

IOW no real improvement, given that 10 chars are no longer in use now.

> 
> Stefan
> > -   len[i] = 1 + (pagewidth - 2 - ((fields 
> > * 3) - 1)) / fields;
> 
> ==len[i] = 1 + (pagewidth - 1 - (fields * 
> 3)) / fields;
> ==len[i] = 1 + (pagewidth - 1) / fields - 
> 3;
> 
> ==len[i] = (pagewidth - 1) / fields - 2;
> 
> ==len[i] = (ws.ws_col - 1) / fields - 2;
> 
> > -   }
> > +   len[i] =  (pagewidth - ((fields * 3) - 
> > 3)) / fields;
> 
> ==len[i] =  (pagewidth + 3) / fields - 3;
> 
> ==len[i] =  (ws.ws_col - 10 + 3) / fields 
> - 3;
> 
> ==len[i] =  (ws.ws_col - 7) / fields - 3;
> 
> > +   } 
> > if (len[i] < MINCOLSIZE)
> > len[i] = MINCOLSIZE;
> > s = mapi_get_name(hdl, i);
> > @@ -1256,7 +1256,7 @@
> > struct winsize ws;
> >  
> > if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0 && ws.ws_col > 0)
> > -   pagewidth = ws.ws_col;
> > +   pagewidth = ws.ws_col - 10;  /* reserve some space for 
> > sliders et al */
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


Re: MonetDB: default - Reserve border space

2010-08-05 Thread Stefan Manegold
On Thu, Aug 05, 2010 at 10:14:10AM +0200, Fabian Groffen wrote:
> On 05-08-2010 09:18:51 +0200, Stefan Manegold wrote:
> > Just for info, here are the simplified terms to facilitate before & after
> > comparison.
> 
> before:
> 
> sql>select NULL;
> +--+
> | single_value
>  |
> +==+
> | null
>  |
> +--+
> 1 tuple (0.668ms)
> sql>select NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL;
> ++-+-+-+-+-+-+-+
> | single | single_ | single_ | single_ | single_ | single_ | single_ | 
> single_ |
> : _value : value   : value   : value   : value   : value   : value   : value  
>  :
> ++=+=+=+=+=+=+=+
> | null   | null| null| null| null| null| null| null   
>  |
> ++-+-+-+-+-+-+-+
> 1 tuple (1.065ms)
> 
> after:
> 
> sql>select NULL;
> ++
> | single_value   |
> ++
> | null   |
> ++
> 1 tuple (0.656ms)
> sql>select NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL;
> +---+---+---++++++
> | singl | singl | singl | single | single | single | single | single |
> : e_val : e_val : e_val : _value : _value : _value : _value : _value :
> : ue: ue: ue::::::
> +===+===+===++++++
> | null  | null  | null  | null   | null   | null   | null   | null   |
> +---+---+---++++++
> 1 tuple (1.086ms)
> 
> IOW no real improvement, given that 10 chars are no longer in use now.

Indeed; in more detail:

Before (Jun2010):

$ echo $COLUMNS
80
$ mclient -lsql -fsql -s'select NULL;'
+--+
| single_value |
+==+
| null |
+--+
1 tuple
$ mclient -lsql -fsql -s'select NULL;' | wc -L
80
$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' 
+-+-+--+
| single_value| single_value| single_value |
+=+=+==+
| null| null| null |
+-+-+--+
1 tuple
$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' | wc -L
80


After (default):

$ echo $COLUMNS
80
$ mclient -lsql -fsql -s'select NULL;'
++
| single_value   |
++
| null   |
++
1 tuple
$ mclient -lsql -fsql -s'select NULL;' | wc -L
70
$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' 
+--+--+--+
| single_value | single_value | single_value |
+==+==+==+
| null | null | null |
+--+--+--+
1 tuple
$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' | wc -L
70



BUT:

Before (Jun2010):

$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' -w80
+-+-+--+
| single_value| single_value| single_value |
+=+=+==+
| null| null| null |
+-+-+--+
1 tuple
$ mclient -lsql -fsql -s'select NULL,NULL,NULL;' -w80 | wc -L
80


After (default):  


MonetDB: default - Backed out changeset ffcd6ef3b2dd

2010-08-05 Thread Fabian Groffen
Changeset: fe802b6c9781 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fe802b6c9781
Modified Files:
clients/src/mapiclient/mclient.mx
Branch: default
Log Message:

Backed out changeset ffcd6ef3b2dd

The effect of the original commit is just limiting the available space
with 10 characters, which is not desirable.  Besides not updating the
documentation, also the commit message seems not to be "in sink" with
the actual code change.


diffs (23 lines):

diff -r ffcd6ef3b2dd -r fe802b6c9781 clients/src/mapiclient/mclient.mx
--- a/clients/src/mapiclient/mclient.mx Tue Aug 03 06:59:10 2010 +0200
+++ b/clients/src/mapiclient/mclient.mx Thu Aug 05 10:16:43 2010 +0200
@@ -1055,8 +1055,8 @@
   available space (+1 so we
   always fully fill the
   terminal) */
-   len[i] =  (pagewidth - ((fields * 3) - 
3)) / fields;
-   } 
+   len[i] = 1 + (pagewidth - 2 - ((fields 
* 3) - 1)) / fields;
+   }
if (len[i] < MINCOLSIZE)
len[i] = MINCOLSIZE;
s = mapi_get_name(hdl, i);
@@ -1256,7 +1256,7 @@
struct winsize ws;
 
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0 && ws.ws_col > 0)
-   pagewidth = ws.ws_col - 10;  /* reserve some space for 
sliders et al */
+   pagewidth = ws.ws_col;
else
 #endif
pagewidth = DEFWIDTH;
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merge in backout

2010-08-05 Thread Fabian Groffen
Changeset: cc958123e39e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc958123e39e
Modified Files:
clients/src/mapiclient/mclient.mx
Branch: default
Log Message:

merge in backout


diffs (23 lines):

diff -r ea1f2c807c50 -r cc958123e39e clients/src/mapiclient/mclient.mx
--- a/clients/src/mapiclient/mclient.mx Thu Aug 05 08:16:41 2010 +0200
+++ b/clients/src/mapiclient/mclient.mx Thu Aug 05 10:17:38 2010 +0200
@@ -1056,8 +1056,8 @@
   available space (+1 so we
   always fully fill the
   terminal) */
-   len[i] =  (pagewidth - ((fields * 3) - 
3)) / fields;
-   } 
+   len[i] = 1 + (pagewidth - 2 - ((fields 
* 3) - 1)) / fields;
+   }
if (len[i] < MINCOLSIZE)
len[i] = MINCOLSIZE;
s = mapi_get_name(hdl, i);
@@ -1257,7 +1257,7 @@
struct winsize ws;
 
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0 && ws.ws_col > 0)
-   pagewidth = ws.ws_col - 10;  /* reserve some space for 
sliders et al */
+   pagewidth = ws.ws_col;
else
 #endif
pagewidth = DEFWIDTH;
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - restored (re-added) file that got lost with

2010-08-05 Thread Stefan Manegold
Changeset: 7c00b0ebe58e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7c00b0ebe58e
Modified Files:
sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py
Branch: default
Log Message:

restored (re-added) file that got lost with
"
 changeset:   37169:b0b2e3ae9928
 parent:  37168:1962b598682b
 parent:  37155:ba2c312a006c
 user:m...@cwi.nl
 date:Thu Aug ^C 08:07:53 2010 +0200
 summary: Merge with june
"


most probabaly because the original file added by Arjen
(most probably not using the check_whitespace HG extension
 that we are "strongly urged" to use; cf.,
 http://homepages.cwi.nl/~sjoerd/downloads/monetdb/MonetDB-Mercurial.html)
contained trailing whitespace,
and then Martin's merge
(most probably using the check_whitespce HG extension)
failed with
"
sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py, line 
76: trailing whitespace added
sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py, line 
80: trailing whitespace added
"
but the failure was overlooked.

Now re-adding the original file with trailing whitespace removed.


diffs (137 lines):

diff -r cc958123e39e -r 7c00b0ebe58e 
sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py   
Thu Aug 05 13:31:46 2010 +0200
@@ -0,0 +1,133 @@
+import sys
+import os
+import time
+from MonetDBtesting import process
+
+def server_readonly():
+s = process.server('sql', args = ["--readonly"],
+   stdin = process.PIPE,
+   stdout = process.PIPE,
+   stderr = process.PIPE)
+s.stdin.write('\nio.printf("\\nReady.\\n");\n')
+s.stdin.flush()
+while True:
+ln = s.stdout.readline()
+if not ln:
+print 'Unexpected EOF from server'
+sys.exit(1)
+sys.stdout.write(ln)
+if 'Ready' in ln:
+break
+return s
+
+def server():
+s = process.server('sql', args = [],
+   stdin = process.PIPE,
+   stdout = process.PIPE,
+   stderr = process.PIPE)
+s.stdin.write('\nio.printf("\\nReady.\\n");\n')
+s.stdin.flush()
+while True:
+ln = s.stdout.readline()
+if not ln:
+print 'Unexpected EOF from server'
+sys.exit(1)
+sys.stdout.write(ln)
+if 'Ready' in ln:
+break
+return s
+
+def server_stop(s):
+out, err = s.communicate()
+sys.stdout.write(out)
+sys.stderr.write(err)
+
+def client(input):
+c = process.client('sql',
+ stdin = process.PIPE,
+ stdout = process.PIPE,
+ stderr = process.PIPE)
+out, err = c.communicate(input)
+sys.stdout.write(out)
+sys.stderr.write(err)
+
+script1 = '''\
+create table t1 (a int);
+'''
+
+script2 = '''\
+create table t2 (a int);
+'''
+
+script3 = '''\
+insert into t1 (a) values ( 1 );
+'''
+
+script4 = '''\
+select * from t1;
+'''
+
+script5 = '''\
+drop table t2;
+'''
+script6 = '''\
+create table t3 (a) as select * from t1 with data;
+'''
+
+script7 = '''\
+create table t4 (a) as select * from t1 with no data;
+'''
+
+script8 = '''\
+drop table t1;
+'''
+
+script9 = '''\
+create table t5 ( like t1 );
+'''
+
+script10 = '''\
+create temporary table t6 ( a int);
+'''
+
+script11 = '''\
+create local temporary table t7 ( a int );
+'''
+
+script12 = '''\
+create global temporary table t8 ( a int );
+'''
+
+script13 = '''\
+update t1 set a = 2 where a = 1;
+'''
+
+script14 = '''\
+delete from t1 where a = 1;
+'''
+
+def main():
+s = server()
+client(script1)
+client(script3)
+client(script4)
+client(script2)
+client(script5)
+server_stop(s)
+s = server_readonly()
+client(script8)
+client(script4)
+client(script2)
+client(script6)
+client(script7)
+client(script9)
+client(script10)
+client(script11)
+client(script12)
+client(script3)
+client(script13)
+client(script14)
+server_stop(s)
+
+if __name__ == '__main__':
+main()
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - removed trailing whitespace

2010-08-05 Thread Stefan Manegold
Changeset: da4d9941923a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=da4d9941923a
Modified Files:
python/test/runtests.py
Branch: default
Log Message:

removed trailing whitespace


diffs (12 lines):

diff -r 7c00b0ebe58e -r da4d9941923a python/test/runtests.py
--- a/python/test/runtests.py   Thu Aug 05 13:31:46 2010 +0200
+++ b/python/test/runtests.py   Thu Aug 05 13:33:23 2010 +0200
@@ -98,7 +98,7 @@
 connect_args = ()
 connect_kwargs = dict(database=TSTDB, port=MAPIPORT, hostname=TSTHOSTNAME,
 username=TSTUSERNAME, password=TSTPASSWORD, autocommit=False)
- 
+
 lower_func = 'lower' # For stored procedure test
 
 def executeDDL1(self,cursor):
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merge of local heads

2010-08-05 Thread Arjen de Rijke
Changeset: b6d72ef39dcf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b6d72ef39dcf
Modified Files:
sql/src/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py
Branch: default
Log Message:

merge of local heads


diffs (truncated from 2114 to 300 lines):

diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/conf/monetdb5.conf.in
--- a/MonetDB5/conf/monetdb5.conf.inThu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/conf/monetdb5.conf.inThu Aug 05 15:16:55 2010 +0200
@@ -231,9 +231,9 @@
 # The datacell pipeline
 
datacell_pipe=inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,datacell,deadcode,reduce,dataflow,history,multiplex,garbageCollector
 
-# The Octopus pipeline for distributed processing (Merovingian enabled
-# platforms only)
+# The Octopus and tarantula pipelines for distributed processing (Merovingian 
enabled platforms only)
 
octopus_pipe=inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,octopus,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+tarantula_pipe=inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,tarantula,deadcode,reduce,dataflow,history,multiplex,garbageCollector
 
 # The MapReduce pipeline for a different flavour of distributed
 # processing on Merovingian enabled platforms
@@ -257,4 +257,4 @@
 # The opt_debug bitvector controls their output. It can be set to a pipeline 
or a comma separated
 # list of optimizers you would like to trace. It is a server wide property and 
can not be set 
 # dynamically, as it is intended for internal use.
-opt_debug=
+opt_debug=tarantula
diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/src/mal/mal_instruction.mx
--- a/MonetDB5/src/mal/mal_instruction.mx   Thu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/src/mal/mal_instruction.mx   Thu Aug 05 15:16:55 2010 +0200
@@ -417,7 +417,7 @@
ptr replica;/* for the replicator tests */
sht recycle;/* execution subject to recycler control */
lng recid;  /* ID given by recycler optimizer */
-   lng octid;
+   lng legid;
sht trap;   /* call debugger when called */
 } *MalBlkPtr, MalBlkRecord;
 
diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/src/mal/mal_namespace.mx
--- a/MonetDB5/src/mal/mal_namespace.mx Thu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/src/mal/mal_namespace.mx Thu Aug 05 15:16:55 2010 +0200
@@ -306,7 +306,9 @@
backup.nmetop++;
 #endif
mal_unset_lock(mal_contextLock,"putName");
-   return putName(nme, len);   /* just to be sure */
+   if ( len)
+   return putName(nme, len);   /* just to be sure */
+   return NULL;
 }
 @-
 The namespace may become a bottleneck when the chain of identifiers grows.
diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/src/modules/mal/mal_init.mx
--- a/MonetDB5/src/modules/mal/mal_init.mx  Thu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/src/modules/mal/mal_init.mx  Thu Aug 05 15:16:55 2010 +0200
@@ -226,6 +226,7 @@
 include opt_strengthReduction;
 include opt_statistics;
 include opt_trace;
+include opt_tarantula;
 include opt_mapreduce;
 
 include chopper;
@@ -247,6 +248,7 @@
 include run_isolate;
 include run_memo;
 include run_octopus;
+include run_tarantula;
 
 @-
 Cracker schemes
diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/src/optimizer/opt_mitosis.mx
--- a/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 15:16:55 2010 +0200
@@ -202,8 +202,8 @@
}
/* we keep the original bind operation, because it allows
for easy undo when the mergtable can not do something
+   pushInstruction(mb,p);
*/
-   pushInstruction(mb,p);

slice= (BUN) (rowcnt/pieces);
hgh.value.vtype= low.value.vtype= TYPE_oid;
diff -r 4a7068be39fc -r b6d72ef39dcf MonetDB5/src/optimizer/opt_octopus.mx
--- a/MonetDB5/src/optimizer/opt_octopus.mx Thu Aug 05 15:14:39 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_octopus.mx Thu Aug 05 15:16:55 2010 +0200
@@ -320,7 +320,7 @@
}
}
 
-   snprintf(buf,BUFSIZ,"exec_"LLFMT, mb->octid);
+   snprintf(buf,BUFSIZ,"exec_"LLFMT, mb->legid);
name2 =  putName(buf,strlen(buf));
 
 /* generate tentacle CALLS: every tentacle is called once on each worker: tcnt 
times */
@@ -465,7 +465,7 @@
return 0;
}
pushInstruction(mb, old[0]);
-   mb->octid = octopusSeq++;
+   mb->legid = octopusSeq++;
 
sig= old[0];
for (i = 1; i < limit; i++) {
@@ -483,7 +483,7 @@
tcnt = p->argc - p->retc;
resType = getVarType(mb, getArg(p,0));
 

MonetDB: default - Add tests for skyserver queue sql queries

2010-08-05 Thread Arjen de Rijke
Changeset: 4a7068be39fc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a7068be39fc
Modified Files:
sql/src/test/ssqq/Tests/All
sql/src/test/ssqq/Tests/insert_query.sql.src
sql/src/test/ssqq/Tests/insert_query.stable.err
sql/src/test/ssqq/Tests/insert_query.stable.out
sql/src/test/ssqq/Tests/insert_queue.sql.src
sql/src/test/ssqq/Tests/insert_queue.stable.err
sql/src/test/ssqq/Tests/insert_queue.stable.out
sql/src/test/ssqq/Tests/insert_quser.sql.src
sql/src/test/ssqq/Tests/insert_quser.stable.err
sql/src/test/ssqq/Tests/insert_quser.stable.out
sql/src/test/ssqq/Tests/ssqq.sql.src
sql/src/test/ssqq/Tests/ssqq.stable.err
sql/src/test/ssqq/Tests/ssqq.stable.out
sql/src/test/ssqq/insert_query.sql
sql/src/test/ssqq/insert_queue.sql
sql/src/test/ssqq/insert_quser.sql
sql/src/test/ssqq/ssqq.sql
Branch: default
Log Message:

Add tests for skyserver queue sql queries


diffs (truncated from 1239 to 300 lines):

diff -r ba2c312a006c -r 4a7068be39fc sql/src/test/ssqq/Tests/All
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/All   Thu Aug 05 15:14:39 2010 +0200
@@ -0,0 +1,4 @@
+ssqq
+insert_quser
+insert_query
+insert_queue
\ No newline at end of file
diff -r ba2c312a006c -r 4a7068be39fc 
sql/src/test/ssqq/Tests/insert_query.sql.src
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/insert_query.sql.src  Thu Aug 05 15:14:39 
2010 +0200
@@ -0,0 +1,1 @@
+$RELSRCDIR/../insert_query.sql
\ No newline at end of file
diff -r ba2c312a006c -r 4a7068be39fc 
sql/src/test/ssqq/Tests/insert_query.stable.err
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/insert_query.stable.err   Thu Aug 05 15:14:39 
2010 +0200
@@ -0,0 +1,84 @@
+stderr of test 'insert_query` in directory 'src/test/ssqq` itself:
+
+
+# 11:37:20 >  
+# 11:37:20 >   mserver5 
"--config=/export/scratch0/rijke/monetdbdefault20100802/etc/monetdb5.conf" 
--debug=10 --set gdk_nr_threads=0 --set 
"monet_mod_path=/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5:/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5/lib:/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5/bin"
 --set 
"gdk_dbfarm=/export/scratch0/rijke/monetdbdefault20100802/var/MonetDB5/dbfarm"  
--set mapi_open=true --set xrpc_open=true --set mapi_port=35016 --set 
xrpc_port=44309 --set monet_prompt= --set mal_listing=2 --trace  
"--dbname=mTests_src_test_ssqq" --set mal_listing=0 ; echo ; echo Over..
+# 11:37:20 >  
+
+# builtin opt  gdk_arch = 64bitx86_64-unknown-linux-gnu
+# builtin opt  gdk_version = 1.39.0
+# builtin opt  prefix = /export/scratch0/rijke/monetdbdefault20100802
+# builtin opt  exec_prefix = ${prefix}
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_admin = adm
+# builtin opt  monet_prompt = >
+# builtin opt  monet_welcome = yes
+# builtin opt  monet_mod_path = ${exec_prefix}/lib/MonetDB
+# builtin opt  monet_daemon = no
+# builtin opt  host = localhost
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_clients = 2
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_debug = 0
+# builtin opt  standoff_ns = 
+# builtin opt  standoff_start = start
+# builtin opt  standoff_end = end
+# config opt   prefix = /export/scratch0/rijke/monetdbdefault20100802
+# config opt   config = ${prefix}/etc/monetdb5.conf
+# config opt   prefix = /export/scratch0/rijke/monetdbdefault20100802
+# config opt   exec_prefix = ${prefix}
+# config opt   gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm
+# config opt   monet_mod_path = 
${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin
+# config opt   mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid
+# config opt   mero_controlport = 50001
+# config opt   sql_optimizer = default_pipe
+# config opt   minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector
+# config opt   default_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   no_mitosis_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sequential_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,history,multiplex,garbageCollector
+# config opt   nov2009_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector

MonetDB: default - Silence compilers

2010-08-05 Thread mk
Changeset: 57db8d431805 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57db8d431805
Modified Files:
MonetDB5/src/optimizer/opt_tarantula.mx
Branch: default
Log Message:

Silence compilers


diffs (21 lines):

diff -r da4d9941923a -r 57db8d431805 MonetDB5/src/optimizer/opt_tarantula.mx
--- a/MonetDB5/src/optimizer/opt_tarantula.mx   Thu Aug 05 13:33:23 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_tarantula.mx   Thu Aug 05 16:18:07 2010 +0200
@@ -589,7 +589,7 @@
MalBlkPtr tm;
char fcn[BUFSIZ];
InstrPtr sig2, sig, r, q;
-   int conn,j,k,l;
+   int conn,j,k = 0,l;
int arg[1024];
 
/* generate stubb code for the remote execution */
@@ -684,7 +684,7 @@
MalBlkPtr tm;
char buf[BUFSIZ], fcn[BUFSIZ];
InstrPtr sig, sig2, r, p,q;
-   int j,k,l,x;
+   int j,k,l,x=0;
 
snprintf(fcn,BUFSIZ,"exe_%s_%d", getFunctionId(getInstrPtr(mb,0)), 
getArg(old[pc],0));
s= newFunction(tarantulaRef, putName(fcn,strlen(fcn)), FUNCTIONsymbol);
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Jun

2010-08-05 Thread mk
Changeset: d0e93651b4a3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d0e93651b4a3
Modified Files:

Branch: default
Log Message:

Merge with Jun


diffs (truncated from 1239 to 300 lines):

diff -r 57db8d431805 -r d0e93651b4a3 sql/src/test/ssqq/Tests/All
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/All   Thu Aug 05 16:24:36 2010 +0200
@@ -0,0 +1,4 @@
+ssqq
+insert_quser
+insert_query
+insert_queue
\ No newline at end of file
diff -r 57db8d431805 -r d0e93651b4a3 
sql/src/test/ssqq/Tests/insert_query.sql.src
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/insert_query.sql.src  Thu Aug 05 16:24:36 
2010 +0200
@@ -0,0 +1,1 @@
+$RELSRCDIR/../insert_query.sql
\ No newline at end of file
diff -r 57db8d431805 -r d0e93651b4a3 
sql/src/test/ssqq/Tests/insert_query.stable.err
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/sql/src/test/ssqq/Tests/insert_query.stable.err   Thu Aug 05 16:24:36 
2010 +0200
@@ -0,0 +1,84 @@
+stderr of test 'insert_query` in directory 'src/test/ssqq` itself:
+
+
+# 11:37:20 >  
+# 11:37:20 >   mserver5 
"--config=/export/scratch0/rijke/monetdbdefault20100802/etc/monetdb5.conf" 
--debug=10 --set gdk_nr_threads=0 --set 
"monet_mod_path=/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5:/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5/lib:/export/scratch0/rijke/monetdbdefault20100802/lib/MonetDB5/bin"
 --set 
"gdk_dbfarm=/export/scratch0/rijke/monetdbdefault20100802/var/MonetDB5/dbfarm"  
--set mapi_open=true --set xrpc_open=true --set mapi_port=35016 --set 
xrpc_port=44309 --set monet_prompt= --set mal_listing=2 --trace  
"--dbname=mTests_src_test_ssqq" --set mal_listing=0 ; echo ; echo Over..
+# 11:37:20 >  
+
+# builtin opt  gdk_arch = 64bitx86_64-unknown-linux-gnu
+# builtin opt  gdk_version = 1.39.0
+# builtin opt  prefix = /export/scratch0/rijke/monetdbdefault20100802
+# builtin opt  exec_prefix = ${prefix}
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_admin = adm
+# builtin opt  monet_prompt = >
+# builtin opt  monet_welcome = yes
+# builtin opt  monet_mod_path = ${exec_prefix}/lib/MonetDB
+# builtin opt  monet_daemon = no
+# builtin opt  host = localhost
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_clients = 2
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_debug = 0
+# builtin opt  standoff_ns = 
+# builtin opt  standoff_start = start
+# builtin opt  standoff_end = end
+# config opt   prefix = /export/scratch0/rijke/monetdbdefault20100802
+# config opt   config = ${prefix}/etc/monetdb5.conf
+# config opt   prefix = /export/scratch0/rijke/monetdbdefault20100802
+# config opt   exec_prefix = ${prefix}
+# config opt   gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm
+# config opt   monet_mod_path = 
${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin
+# config opt   mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid
+# config opt   mero_controlport = 50001
+# config opt   sql_optimizer = default_pipe
+# config opt   minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector
+# config opt   default_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   no_mitosis_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sequential_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,history,multiplex,garbageCollector
+# config opt   nov2009_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   replication_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector
+# config opt   accumulator_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,accumulators,dataflow,history,multiplex,garbageCollector
+# config opt   recycler_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,deadcode,recycle,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   cracker_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,selcrack,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   s

MonetDB: default - fixed compilation with assertions disabled:

2010-08-05 Thread Stefan Manegold
Changeset: e9d9b58d5f1e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e9d9b58d5f1e
Modified Files:
sql/src/backends/monet5/sql_optimizer.mx
Branch: default
Log Message:

fixed compilation with assertions disabled:

variable "msg" is only used in an "assert()" call;
hence we better ensure that is is also declared
only if assertions are enabled;
this prevents
"
sql/src/backends/monet5/sql_optimizer.mx(337): error #177: variable "msg" was 
declared but never referenced
  str msg = getContext(cntxt,mb, &m, NULL);
  ^
"


diffs (13 lines):

diff -r d0e93651b4a3 -r e9d9b58d5f1e sql/src/backends/monet5/sql_optimizer.mx
--- a/sql/src/backends/monet5/sql_optimizer.mx  Thu Aug 05 16:24:36 2010 +0200
+++ b/sql/src/backends/monet5/sql_optimizer.mx  Thu Aug 05 16:56:34 2010 +0200
@@ -334,7 +334,9 @@
sql_bpm *bpm = NULL;
sql_schema *s = mvc_bind_schema(m, sname);
mvc *m = NULL;
+#ifndef NDEBUG
str msg = getContext(cntxt,mb, &m, NULL);
+#endif
BAT *b;
 
assert(msg == MAL_SUCCEED);
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - fixed problem(s) with mat.slice.

2010-08-05 Thread Niels Nes
Changeset: 05cd69c91094 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=05cd69c91094
Modified Files:
MonetDB5/src/modules/kernel/algebra.mx
MonetDB5/src/optimizer/opt_mergetable.mx
sql/src/server/rel_bin.mx
sql/src/server/sql_statement.mx

sql/src/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out
Branch: Jun2010
Log Message:

fixed problem(s) with mat.slice.

1) we now slice(offset,NIL), incase there is no limit
   (we used to do slice(o,offset)/kdiff.
That solved also the mergetable optimizer problems
2) in mergetable optimizer we now keep the mat.pack as other statements
   may use it (shouldn't but may always happen, incase of bad hand writen mal 
code)
3) fixed slice(bat, l, h) to handle h== nil


diffs (203 lines):

diff -r 5a9d3031917a -r 05cd69c91094 MonetDB5/src/modules/kernel/algebra.mx
--- a/MonetDB5/src/modules/kernel/algebra.mxThu Aug 05 07:55:55 2010 +0200
+++ b/MonetDB5/src/modules/kernel/algebra.mxThu Aug 05 19:48:59 2010 +0200
@@ -1871,6 +1871,8 @@
GDKerror("CMDslice: start position of slice should >= 0\n");
return GDK_FAIL;
}
+   if (end == wrd_nil) 
+   end = BATcount(b);
if (start > (lng) BUN_MAX || end >= (lng) BUN_MAX) {
GDKerror("CMDslice: argument out of range\n");
return GDK_FAIL;
diff -r 5a9d3031917a -r 05cd69c91094 MonetDB5/src/optimizer/opt_mergetable.mx
--- a/MonetDB5/src/optimizer/opt_mergetable.mx  Thu Aug 05 07:55:55 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mergetable.mx  Thu Aug 05 19:48:59 2010 +0200
@@ -1743,12 +1743,12 @@
 Disabled as a slice is used also for offset where we need the oposite
 of the slice part. y= x.slice(). x.diff(y);
 @c
-   if (0 && match > 0 && getModuleId(p) == algebraRef &&
+   if (match > 0 && getModuleId(p) == algebraRef &&
getFunctionId(p) == sliceRef &&
(m = isMATalias(getArg(p, 1), mat, mtop)) >= 0)
{
/* inject new mat.pack() operation */
-   MATpackAll2(mb, NULL, mat, m, &mtop);
+   MATpackAll(mb, NULL, mat, m, &mtop);
q = getInstrPtr(mb, mb->stop - 1);
/* rename mat.pack() to mat.slice() */
setFunctionId(q, sliceRef);
diff -r 5a9d3031917a -r 05cd69c91094 sql/src/server/rel_bin.mx
--- a/sql/src/server/rel_bin.mx Thu Aug 05 07:55:55 2010 +0200
+++ b/sql/src/server/rel_bin.mx Thu Aug 05 19:48:59 2010 +0200
@@ -1948,17 +1948,22 @@
 
if (n) {
stmt *limit = NULL, *p, *j;
-   sql_exp *lmt = le;
+   //sql_exp *lmt = le;
 
if (le)
l = exp_bin(sql, le, NULL, NULL, NULL, NULL);
if (oe)
o = exp_bin(sql, oe, NULL, NULL, NULL, NULL);
 
+/*
if (!le) {
l = o;
o = stmt_atom_wrd(0);
}
+*/
+
+   if (!le) 
+   l = stmt_atom_wrd_nil();
if (!o)
o = stmt_atom_wrd(0);
 
@@ -1971,19 +1976,21 @@
 
sc = column(sc);
limit = stmt_limit(stmt_alias(sc, tname, cname), o, l, 
0);
-   if (lmt) {
+   //if (lmt) {
n = n->next;
list_append(newl, limit);
-   }
+   //}
}
 
/* reduce pivot */
j = find_projection_join(limit);
if (j && 0) {
p = find_pivot(j);
+/*
if (!lmt)
p = stmt_diff(stmt_dup(p), stmt_dup(limit));
else
+*/
p = stmt_semijoin(stmt_dup(p), stmt_dup(limit));
for ( ; n; n = n->next) {
stmt *s = column(stmt_dup(n->data));
@@ -1999,20 +2006,24 @@
for ( ; n; n = n->next) {
stmt *s;

+/*
if (!lmt)
s = 
stmt_diff(column(stmt_dup(n->data)), stmt_dup(limit));
else
+*/
s = 
stmt_semijoin(column(stmt_dup(n->data)), stmt_dup(limit));
list_append(newl, s);
}
}
if (order) {
+/*
if (!lmt) {
order = stmt_diff(order, limit);
} else {
+*/
stmt_destroy(order);
order = limit;
-   }
+/

MonetDB: Jun2010 - use a general getRowsProp (moved to opt_suppo...

2010-08-05 Thread Niels Nes
Changeset: d493590d4c1c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d493590d4c1c
Modified Files:
MonetDB5/src/optimizer/opt_costModel.mx
MonetDB5/src/optimizer/opt_emptySet.mx
MonetDB5/src/optimizer/opt_mitosis.mx
MonetDB5/src/optimizer/opt_pushranges.mx
MonetDB5/src/optimizer/opt_support.mx
sql/src/backends/monet5/sql_optimizer.mx
Branch: Jun2010
Log Message:

use a general getRowsProp (moved to opt_support) to always get the value
of rowsProp in a save way.
In sql always set the rowsProp as type_wrd.


diffs (202 lines):

diff -r 05cd69c91094 -r d493590d4c1c MonetDB5/src/optimizer/opt_costModel.mx
--- a/MonetDB5/src/optimizer/opt_costModel.mx   Thu Aug 05 19:48:59 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_costModel.mx   Thu Aug 05 21:42:14 2010 +0200
@@ -87,24 +87,6 @@
 #include "mal_config.h"
 #include "opt_costModel.h"
 
-static lng 
-getVarRows(MalBlkPtr mb, int v)
-{
-   VarPtr p = varGetProp(mb, v, rowsProp);
-   
-   if (!p)
-   return -1;
-   if (p->value.vtype == TYPE_lng)
-   return p->value.val.lval;
-   if (p->value.vtype == TYPE_int)
-   return p->value.val.ival;
-   if (p->value.vtype == TYPE_sht)
-   return p->value.val.shval;
-   if (p->value.vtype == TYPE_bte)
-   return p->value.val.btval;
-   return -1;
-}
-
 @-
 The cost formula are repetative
 @= newRows
@@ -116,7 +98,7 @@
if (c1 == -1 || c2 == -1) 
continue;
k = (@3);
-   varSetProp(mb, getArg(p,@4), rowsProp, op_eq, 
VALset(&v,TYPE_lng,&k));
+   varSetProp(mb, getArg(p,@4), rowsProp, op_eq, 
VALset(&v,TYPE_wrd,&k));
 #ifdef DEBUG_OPT_COSTMODEL
stream_printf(cntxt->fdout,"COST of @1 @2 into @4: " LLFMT 
"\n",k);
printInstruction(cntxt->fdout,mb,0,p,0);
@@ -132,7 +114,7 @@
 @c
 static void
 OPTbackpropagate(MalBlkPtr mb, int i, int idx){
-   lng rows;
+   wrd rows;
InstrPtr p;
 
 rows = getVarRows(mb, idx);
@@ -142,7 +124,7 @@
p = getInstrPtr(mb,i);
if (getFunctionId(p) == setWriteModeRef){
if (getVarRows(mb, getArg(p,1)) == 0) {
-   ValRecord v, *vp = VALset(&v, TYPE_lng, &rows);
+   ValRecord v, *vp = VALset(&v, TYPE_wrd, &rows);
varSetProp(mb, getArg(p,1), rowsProp, op_eq, 
vp);
}
} 
@@ -162,7 +144,7 @@
 OPTcostModelImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci)
 {
int i;
-   lng k, c1, c2;
+   wrd k, c1, c2;
InstrPtr p;
str sortrevRef= putName("sortReverse",11);
str sortrevTailRef= putName("sortReverseTail",15);
@@ -277,7 +259,7 @@
if (c1 != -1) {
ValRecord v;

-   varSetProp(mb, getArg(p,0), rowsProp, op_eq, 
VALset(&v, TYPE_lng, &c1));
+   varSetProp(mb, getArg(p,0), rowsProp, op_eq, 
VALset(&v, TYPE_wrd, &c1));
}
}
}
diff -r 05cd69c91094 -r d493590d4c1c MonetDB5/src/optimizer/opt_emptySet.mx
--- a/MonetDB5/src/optimizer/opt_emptySet.mxThu Aug 05 19:48:59 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_emptySet.mxThu Aug 05 21:42:14 2010 +0200
@@ -321,8 +321,7 @@
 #endif
for (i = 0; i < mb->vtop; i++) {
VarPtr rowsp;
-   if ((rowsp = varGetProp(mb, i, rowsProp)) != NULL 
-&& rowsp->value.val.lval == 0) {
+   if (getVarRows(mb, i) == 0) {
 #ifdef DEBUG_OPT_EMPTYSET
stream_printf(cntxt->fdout, "START emptyset optimizer %d", i);
 #endif
diff -r 05cd69c91094 -r d493590d4c1c MonetDB5/src/optimizer/opt_mitosis.mx
--- a/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 19:48:59 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 21:42:14 2010 +0200
@@ -116,19 +116,12 @@
 base table and passes them on as a row property.
 All pieces for a single subplan should ideally fit together.
 @c
-   v= varGetProp(mb, getArg(q,0), rowsProp);
-   if (v && v->value.val.lval >= 0
-#if SIZEOF_BUN <= SIZEOF_INT
-   && v->value.val.lval <= BUN_MAX
-#endif
-  )
-   r= (BUN) v->value.val.lval;
-   if (r >= rowcnt && r > PARTITION_THRESHOLD){
-   rowcnt = r;
-   target = q;
-   estimate++;
-   r = 0;
-   }
+   r = getVarRows(mb, getArg(q, 0));
+   if (r >= 0 && r >= rowcnt && r > PARTITION_THRESHOLD){
+   rowcnt = r;
+   target = q;

Re: MonetDB: Jun2010 - use a general getRowsProp (moved to opt_suppo...

2010-08-05 Thread Stefan Manegold
Niels,

thanks for taking care of this!!

However, the changes seem to be committed prematurely and do not compile,
yet:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer 
-I../.. 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer 
-I../mal 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../mal
 -I../modules/atoms 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/atoms
 -I../modules/mal 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/mal
 -I../modules/kernel 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/kernel
 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB
 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB/common
 
-I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB/gdk
 -DLIBOPTIMIZER -Wall -Wextra -fno-strict-aliasing -g 
-Werror-implicit-function-declaration -Werror -Wpointer-arith 
-Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2 -D_REENTRANT -c 
opt_prelude.c  -fPIC -DPIC -o .libs/lib_optimizer_la-opt_prelude.o
In file included from opt_prelude.h:22,
 from 
/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/opt_prelude.mx:225:
opt_support.h: In function ‘getVarRows’:
opt_support.h:90: error: ‘rowsProp’ undeclared (first use in this function)
opt_support.h:90: error: (Each undeclared identifier is reported only once
opt_support.h:90: error: for each function it appears in.)
opt_support.h:95: error: expected ‘)’ before ‘return’
/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/opt_prelude.mx:609:
 error: expected declaration or statement at end of input
make[5]: *** [lib_optimizer_la-opt_prelude.lo] Error 1



On Thu, Aug 05, 2010 at 09:42:20PM +0200, Niels Nes wrote:
> Changeset: d493590d4c1c for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d493590d4c1c
> Modified Files:
>   MonetDB5/src/optimizer/opt_costModel.mx
>   MonetDB5/src/optimizer/opt_emptySet.mx
>   MonetDB5/src/optimizer/opt_mitosis.mx
>   MonetDB5/src/optimizer/opt_pushranges.mx
>   MonetDB5/src/optimizer/opt_support.mx
>   sql/src/backends/monet5/sql_optimizer.mx
> Branch: Jun2010
> Log Message:
> 
> use a general getRowsProp (moved to opt_support) to always get the value
> of rowsProp in a save way.
> In sql always set the rowsProp as type_wrd.
> 
[...]
> diff -r 05cd69c91094 -r d493590d4c1c MonetDB5/src/optimizer/opt_support.mx
> --- a/MonetDB5/src/optimizer/opt_support.mx   Thu Aug 05 19:48:59 2010 +0200
> +++ b/MonetDB5/src/optimizer/opt_support.mx   Thu Aug 05 21:42:14 2010 +0200
> @@ -1338,5 +1338,32 @@
>   return 0;
>  }
>  @h
> +
> +opt_export wrd getVarRows(MalBlkPtr mb, int v);
> +
>  #endif /* _OPT_SUPPORT_H */
>  @}
> +
> +wrd 
> +getVarRows(MalBlkPtr mb, int v)
> +{
> + VarPtr p = varGetProp(mb, v, rowsProp);
> + 
> + if (!p)
> + return -1;
> + if (p->value.vtype == TYPE_wrd
  ^

> + return p->value.val.wval;
> + if (p->value.vtype == TYPE_lng
> +#if SIZEOF_BUN <= SIZEOF_INT
> + && p->value.val.lval <= BUN_MAX)
> +#endif
> + return (wrd)p->value.val.lval;
> + if (p->value.vtype == TYPE_int)
> + return p->value.val.ival;
> + if (p->value.vtype == TYPE_sht)
> + return p->value.val.shval;
> + if (p->value.vtype == TYPE_bte)
> + return p->value.val.btval;
> + return -1;
> +}
> +
[...]

-- 
| Dr. Stefan Manegold | mailto:stefan.maneg...@cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212   |
| The Netherlands | Fax : +31 (20) 592-4199   |
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - added missing @c

2010-08-05 Thread Niels Nes
Changeset: 3b5c587485ff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b5c587485ff
Modified Files:
MonetDB5/src/optimizer/opt_support.mx
Branch: Jun2010
Log Message:

added missing @c


diffs (11 lines):

diff -r d493590d4c1c -r 3b5c587485ff MonetDB5/src/optimizer/opt_support.mx
--- a/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 21:42:14 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 22:05:28 2010 +0200
@@ -1344,6 +1344,7 @@
 #endif /* _OPT_SUPPORT_H */
 @}
 
+...@c
 wrd 
 getVarRows(MalBlkPtr mb, int v)
 {
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


Re: MonetDB: Jun2010 - use a general getRowsProp (moved to opt_suppo...

2010-08-05 Thread Niels Nes
On Thu, Aug 05, 2010 at 09:58:23PM +0200, Stefan Manegold wrote:
> Niels,
> 
> thanks for taking care of this!!
should be fixed now

Niels
> 
> However, the changes seem to be committed prematurely and do not compile,
> yet:
> 
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer 
> -I../.. 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer 
> -I../mal 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../mal
>  -I../modules/atoms 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/atoms
>  -I../modules/mal 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/mal
>  -I../modules/kernel 
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/../modules/kernel
>  
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB
>  
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB/common
>  
> -I/ufs/manegold/_/scratch0/Monet/HG/Jun2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/include/MonetDB/gdk
>  -DLIBOPTIMIZER -Wall -Wextra -fno-strict-aliasing -g 
> -Werror-implicit-function-declaration -Werror -Wpointer-arith 
> -Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2 -D_REENTRANT -c 
> opt_prelude.c  -fPIC -DPIC -o .libs/lib_optimizer_la-opt_prelude.o
> In file included from opt_prelude.h:22,
>  from 
> /ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/opt_prelude.mx:225:
> opt_support.h: In function ‘getVarRows’:
> opt_support.h:90: error: ‘rowsProp’ undeclared (first use in this function)
> opt_support.h:90: error: (Each undeclared identifier is reported only once
> opt_support.h:90: error: for each function it appears in.)
> opt_support.h:95: error: expected ‘)’ before ‘return’
> /ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/optimizer/opt_prelude.mx:609:
>  error: expected declaration or statement at end of input
> make[5]: *** [lib_optimizer_la-opt_prelude.lo] Error 1
> 
> 
> 
> On Thu, Aug 05, 2010 at 09:42:20PM +0200, Niels Nes wrote:
> > Changeset: d493590d4c1c for MonetDB
> > URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d493590d4c1c
> > Modified Files:
> > MonetDB5/src/optimizer/opt_costModel.mx
> > MonetDB5/src/optimizer/opt_emptySet.mx
> > MonetDB5/src/optimizer/opt_mitosis.mx
> > MonetDB5/src/optimizer/opt_pushranges.mx
> > MonetDB5/src/optimizer/opt_support.mx
> > sql/src/backends/monet5/sql_optimizer.mx
> > Branch: Jun2010
> > Log Message:
> > 
> > use a general getRowsProp (moved to opt_support) to always get the value
> > of rowsProp in a save way.
> > In sql always set the rowsProp as type_wrd.
> > 
> [...]
> > diff -r 05cd69c91094 -r d493590d4c1c MonetDB5/src/optimizer/opt_support.mx
> > --- a/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 19:48:59 2010 +0200
> > +++ b/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 21:42:14 2010 +0200
> > @@ -1338,5 +1338,32 @@
> > return 0;
> >  }
> >  @h
> > +
> > +opt_export wrd getVarRows(MalBlkPtr mb, int v);
> > +
> >  #endif /* _OPT_SUPPORT_H */
> >  @}
> > +
> > +wrd 
> > +getVarRows(MalBlkPtr mb, int v)
> > +{
> > +   VarPtr p = varGetProp(mb, v, rowsProp);
> > +   
> > +   if (!p)
> > +   return -1;
> > +   if (p->value.vtype == TYPE_wrd
>   ^
> 
> > +   return p->value.val.wval;
> > +   if (p->value.vtype == TYPE_lng
> > +#if SIZEOF_BUN <= SIZEOF_INT
> > +   && p->value.val.lval <= BUN_MAX)
> > +#endif
> > +   return (wrd)p->value.val.lval;
> > +   if (p->value.vtype == TYPE_int)
> > +   return p->value.val.ival;
> > +   if (p->value.vtype == TYPE_sht)
> > +   return p->value.val.shval;
> > +   if (p->value.vtype == TYPE_bte)
> > +   return p->value.val.btval;
> > +   return -1;
> > +}
> > +
> [...]
> 
> -- 
> | Dr. Stefan Manegold | mailto:stefan.maneg...@cwi.nl |
> | CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
> | 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212   |
> | The Netherlands | Fax : +31 (20) 592-4199   |

-- 
Niels Nes, Centrum Wiskunde & Informatica (CWI)
Science Park 123, 1098 XG Amsterdam, The Netherlands
room L3.14,  phone ++31 20 592-4098 sip:4...@sip.cwi.nl
url: http://www.cwi.nl/~niels   e-mail: niels@cwi.nl
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - fix compilation

2010-08-05 Thread Niels Nes
Changeset: 61c63236a426 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=61c63236a426
Modified Files:
MonetDB5/src/optimizer/opt_support.mx
Branch: Jun2010
Log Message:

fix compilation


diffs (12 lines):

diff -r 3b5c587485ff -r 61c63236a426 MonetDB5/src/optimizer/opt_support.mx
--- a/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 22:05:28 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 22:06:44 2010 +0200
@@ -1352,7 +1352,7 @@

if (!p)
return -1;
-   if (p->value.vtype == TYPE_wrd
+   if (p->value.vtype == TYPE_wrd)
return p->value.val.wval;
if (p->value.vtype == TYPE_lng
 #if SIZEOF_BUN <= SIZEOF_INT
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - fix compilation on 64 bits

2010-08-05 Thread Niels Nes
Changeset: 99a895214174 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99a895214174
Modified Files:
MonetDB5/src/optimizer/opt_support.mx
Branch: Jun2010
Log Message:

fix compilation on 64 bits


diffs (14 lines):

diff -r 61c63236a426 -r 99a895214174 MonetDB5/src/optimizer/opt_support.mx
--- a/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 22:06:44 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_support.mx Thu Aug 05 22:08:01 2010 +0200
@@ -1356,8 +1356,9 @@
return p->value.val.wval;
if (p->value.vtype == TYPE_lng
 #if SIZEOF_BUN <= SIZEOF_INT
-   && p->value.val.lval <= BUN_MAX)
+   && p->value.val.lval <= BUN_MAX
 #endif
+   )
return (wrd)p->value.val.lval;
if (p->value.vtype == TYPE_int)
return p->value.val.ival;
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - fixed more compilation issues

2010-08-05 Thread Niels Nes
Changeset: bab0b4231ed8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bab0b4231ed8
Modified Files:
MonetDB5/src/optimizer/opt_emptySet.mx
MonetDB5/src/optimizer/opt_mitosis.mx
Branch: Jun2010
Log Message:

fixed more compilation issues


diffs (42 lines):

diff -r 99a895214174 -r bab0b4231ed8 MonetDB5/src/optimizer/opt_emptySet.mx
--- a/MonetDB5/src/optimizer/opt_emptySet.mxThu Aug 05 22:08:01 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_emptySet.mxThu Aug 05 22:12:38 2010 +0200
@@ -320,7 +320,6 @@
printFunction(cntxt->fdout, mb,0, LIST_MAL_ALL);
 #endif
for (i = 0; i < mb->vtop; i++) {
-   VarPtr rowsp;
if (getVarRows(mb, i) == 0) {
 #ifdef DEBUG_OPT_EMPTYSET
stream_printf(cntxt->fdout, "START emptyset optimizer %d", i);
diff -r 99a895214174 -r bab0b4231ed8 MonetDB5/src/optimizer/opt_mitosis.mx
--- a/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 22:08:01 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mitosis.mx Thu Aug 05 22:12:38 2010 +0200
@@ -66,7 +66,7 @@
 #include "mal_interpreter.h"
 
 /* #define _DEBUG_OPT_MITOSIS*/
-#define PARTITION_THRESHOLD (BUN) GDKnr_threads/* should be increased 
in production version */
+#define PARTITION_THRESHOLD (wrd) GDKnr_threads/* should be increased 
in production version */
 
 static int eligible(MalBlkPtr mb )
 {
@@ -91,9 +91,8 @@
str schema=0, table=0;
VarRecord low,hgh;
oid slice;
-   BUN r=0,rowcnt=0;   /* table should be sizeable to consider 
parallel execution*/
+   wrd r = 0, rowcnt=0;/* table should be sizeable to consider 
parallel execution*/
InstrPtr q,*old, target= 0, matq;
-   VarPtr v;
size_t typewidth= 3 *sizeof(lng); /* 2 arguments and a result */
 
(void)cntxt;
@@ -123,6 +122,7 @@
estimate++;
r = 0;
}
+   }
if (target == 0)
return 0;
 @-
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - approved stable output according to Niels' ro...

2010-08-05 Thread Stefan Manegold
Changeset: 8aa106e2a289 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8aa106e2a289
Modified Files:
MonetDB5/src/optimizer/Tests/CMexample.stable.out
MonetDB5/src/optimizer/Tests/emptyset00.stable.out
MonetDB5/src/optimizer/Tests/emptyset01.stable.out
MonetDB5/src/optimizer/Tests/rangePush01.stable.out
MonetDB5/src/optimizer/Tests/tst4730.stable.out
Branch: Jun2010
Log Message:

approved stable output according to Niels' rowsProp changes:
basically "{rows=123:lng}" -> "{rows=123}",
i.e., no more :lng type specification in echoed MAL code


diffs (158 lines):

diff -r bab0b4231ed8 -r 8aa106e2a289 
MonetDB5/src/optimizer/Tests/CMexample.stable.out
--- a/MonetDB5/src/optimizer/Tests/CMexample.stable.out Thu Aug 05 22:12:38 
2010 +0200
+++ b/MonetDB5/src/optimizer/Tests/CMexample.stable.out Thu Aug 05 23:15:48 
2010 +0200
@@ -26,9 +26,9 @@
 # Cost model example 
 r{rows=100} := bat.new(:oid,:int);  #  2 r:bat[:oid,:int] := 
CMDBATnew(_4:oid, _5:int) {G}
 s{rows=1000} := bat.new(:oid,:int); #  3 s:bat[:oid,:int] := 
CMDBATnew(_4:oid, _8:int) {G}
-rs{rows=501:lng} := algebra.select(s{rows=1000},1,1);#  4 
rs:bat[:oid,:int] := ALGselect(s:bat[:oid,:int], _10:int, _10:int) {G}
-rr{rows=100:lng} := bat.reverse(r{rows=100});#  5 rr:bat[:int,:oid] := 
BKCreverse(r:bat[:oid,:int]) {G}
-j{rows=100:lng} := algebra.join(rs{rows=501:lng},rr{rows=100:lng});#  6 
j:bat[:oid,:oid] := ALGjoin(rs:bat[:oid,:int], rr:bat[:int,:oid]) {G}
+rs{rows=501} := algebra.select(s{rows=1000},1,1);#  4 rs:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], _10:int, _10:int) {G}
+rr{rows=100} := bat.reverse(r{rows=100});#  5 rr:bat[:int,:oid] := 
BKCreverse(r:bat[:oid,:int]) {G}
+j{rows=100} := algebra.join(rs{rows=501},rr{rows=100});#  6 
j:bat[:oid,:oid] := ALGjoin(rs:bat[:oid,:int], rr:bat[:int,:oid]) {G}
 mdb.List(); #  7 _14:void := MDBlistDetail() 
 end main;   #  8  
 
diff -r bab0b4231ed8 -r 8aa106e2a289 
MonetDB5/src/optimizer/Tests/emptyset00.stable.out
--- a/MonetDB5/src/optimizer/Tests/emptyset00.stable.outThu Aug 05 
22:12:38 2010 +0200
+++ b/MonetDB5/src/optimizer/Tests/emptyset00.stable.outThu Aug 05 
23:15:48 2010 +0200
@@ -28,9 +28,9 @@
 function user.main():void;  #  0 main:void := user.main() {G}
 b := bat.new(:oid,:int);#  1 b:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
 s1 := algebra.select(b,80,90);  #  2 s1:bat[:oid,:int] := 
ALGselect(b:bat[:oid,:int], _5:int, _6:int) {G}
-s2{rows=0:lng} := bat.new(:oid,:int);#  3 s2:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
-s3{rows=0:lng} := bat.new(:oid,:int);#  4 s3:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
-io.print(s3{rows=0:lng});   #  5 _9:void := 
IOprint_val(s3:bat[:oid,:int]) {G}
+s2{rows=0} := bat.new(:oid,:int);   #  3 s2:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
+s3{rows=0} := bat.new(:oid,:int);   #  4 s3:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
+io.print(s3{rows=0});   #  5 _9:void := 
IOprint_val(s3:bat[:oid,:int]) {G}
 mdb.List(); #  6 _12:void := MDBlistDetail() 
 end main;   #  7  
 
diff -r bab0b4231ed8 -r 8aa106e2a289 
MonetDB5/src/optimizer/Tests/emptyset01.stable.out
--- a/MonetDB5/src/optimizer/Tests/emptyset01.stable.outThu Aug 05 
22:12:38 2010 +0200
+++ b/MonetDB5/src/optimizer/Tests/emptyset01.stable.outThu Aug 05 
23:15:48 2010 +0200
@@ -39,7 +39,7 @@
 V1 := bat.new(:oid,:int);   #  1 V1:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
 V7 := bat.new(:oid,:int);   #  2 V7:bat[:oid,:int] := 
CMDBATnew(_2:oid, _3:int) {G}
 V10{rows=0:lng} := bat.new(:int,:oid);#  3 V10:bat[:int,:oid] := 
CMDBATnew(_3:int, _2:oid) {G}
-V11{rows=0:lng} := bat.reverse(V10{rows=0:lng});#  4 V11:bat[:oid,:int] := 
BKCreverse(V10:bat[:int,:oid]) {G}
+V11{rows=0} := bat.reverse(V10{rows=0:lng});#  4 V11:bat[:oid,:int] := 
BKCreverse(V10:bat[:int,:oid]) {G}
 V12 := V7;  #  5 V12:bat[:oid,:int] := 
V7:bat[:oid,:int] {G}
 V16 := algebra.markT(V12);  #  6 V16:bat[:oid,:oid] := 
ALGtmark_default(V12:bat[:oid,:int]) {G}
 V17 := algebra.join(V16,V7);#  7 V17:bat[:oid,:int] := 
ALGjoin(V16:bat[:oid,:oid], V7:bat[:oid,:int]) {G}
diff -r bab0b4231ed8 -r 8aa106e2a289 
MonetDB5/src/optimizer/Tests/rangePush01.stable.out
--- a/MonetDB5/src/optimizer/Tests/rangePush01.stable.out   Thu Aug 05 
22:12:38 2010 +0200
+++ b/MonetDB5/src/optimizer/Tests/rangePush01.stable.out   Thu Aug 05 
23:15:48 2010 +0200
@@ -29,12 +29,12 @@
 # detect empty ranges 
 b := bat.new(:void,:int);   #  2 b:bat[:void,:int] := 
CMDBATnew(_3:void, _4:int) {G}
 s1 := algebra.select(b,80,90);  #  3 s1:bat[:void,:int] := 
ALGselect(b:bat[:void,:int], _6:int, _7:int) {G}

MonetDB: default - [mq]: zorder.patch

2010-08-05 Thread Jennie Zhang
Changeset: c9bb76c454ec for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9bb76c454ec
Modified Files:
MonetDB5/src/modules/mal/Tests/zorder.mal
MonetDB5/src/modules/mal/zorder.mx
Branch: default
Log Message:

[mq]: zorder.patch


diffs (237 lines):

diff -r e9d9b58d5f1e -r c9bb76c454ec MonetDB5/src/modules/mal/Tests/zorder.mal
--- a/MonetDB5/src/modules/mal/Tests/zorder.mal Thu Aug 05 16:56:34 2010 +0200
+++ b/MonetDB5/src/modules/mal/Tests/zorder.mal Thu Aug 05 17:06:49 2010 +0200
@@ -21,6 +21,15 @@
 (x,y):= zorder.decode(z3); io.print(x,y);
 (x,y):= zorder.decode(z4); io.print(x,y);
 
+x := zorder.decode_x(z1);
+y := zorder.decode_y(z1); io.print(x, y);
+x := zorder.decode_x(z2);
+y := zorder.decode_y(z2); io.print(x, y);
+x := zorder.decode_x(z3);
+y := zorder.decode_y(z3); io.print(x, y);
+x := zorder.decode_x(z4);
+y := zorder.decode_y(z4); io.print(x, y);
+
 bx:= bat.new(:oid,:int);
 bat.append(bx,0);
 bat.append(bx,1);
@@ -62,6 +71,9 @@
 io.print(bz);
 (cx,cy):= zorder.decode(bz);
 io.print(cx,cy);
+dx:= zorder.decode_x(bz);
+dy:= zorder.decode_y(bz);
+io.print(dx,dy);
 
 # taking a slice
 bs:= zorder.slice(1,1,3,3);
diff -r e9d9b58d5f1e -r c9bb76c454ec MonetDB5/src/modules/mal/zorder.mx
--- a/MonetDB5/src/modules/mal/zorder.mxThu Aug 05 16:56:34 2010 +0200
+++ b/MonetDB5/src/modules/mal/zorder.mxThu Aug 05 17:06:49 2010 +0200
@@ -49,6 +49,22 @@
 address ZORDbatdecode_int_oid
 comment "Derive the z-order pair";
 
+command decode_x(z:oid)(x:int)
+address ZORDdecode_int_oid_x
+comment "Derive the z-order x-coordinate";
+
+command decode_x(z:bat[:oid,:oid]):bat[:oid,:int]
+address ZORDbatdecode_int_oid_x
+comment "Derive the z-order x-coordinate";
+
+command decode_y(z:oid)(y:int)
+address ZORDdecode_int_oid_y
+comment "Derive the z-order y-coordinate";
+
+command decode_y(z:bat[:oid,:oid]):bat[:oid,:int]
+address ZORDbatdecode_int_oid_y
+comment "Derive the z-order y-coordinate";
+
 command slice(xb:int, yb:int, xt:int, yt:int ):bat[:oid,:oid]
 address ZORDslice_int
 comment "Extract the Z-order indices between two points";
@@ -71,7 +87,11 @@
 zorder_export str ZORDencode_int_oid(oid *z, int *x, int *y);
 zorder_export str ZORDbatencode_int_oid(int *z, int *x, int *y);
 zorder_export str ZORDdecode_int_oid(int *x, int *y, oid *z);
+zorder_export str ZORDdecode_int_oid_x(int *x, oid *z);
+zorder_export str ZORDdecode_int_oid_y(int *y, oid *z);
 zorder_export str ZORDbatdecode_int_oid(int *x, int *y, int *z);
+zorder_export str ZORDbatdecode_int_oid_x(int *x, int *z);
+zorder_export str ZORDbatdecode_int_oid_y(int *y, int *z);
 zorder_export str ZORDslice_int(int *r, int *xb, int *yb, int *xt, int *yt);
 
 #endif /* _ZORDER_H */
@@ -113,6 +133,31 @@
*x = xv;
*y = yv;
 }
+static inline void zdeco...@1_@2_x(@1 *x, @2 *z)
+{
+   @1 xv = 0, mask =1;
+   @2 zv = *z;
+   int i;
+   for ( i = 0; i < (int) (8 * sizeof(@2)); i+= 2) {
+   xv |= ((zv & 1) * mask);
+   zv >>= 2;
+   mask <<=1;
+   }
+   *x = xv;
+}
+static inline void zdeco...@1_@2_y(@1 *y, @2 *z)
+{
+   @1 yv=0, mask =1;
+   @2 zv = *z;
+   int i;
+   for ( i = 0; i < (int) (8 * sizeof(@2)); i+= 2) {
+   zv >>= 1;
+   yv |= ((zv & 1) * mask);
+   zv >>= 1;
+   mask <<=1;
+   }
+   *y = yv;
+}
 @c
 @:Zcode(int,oid)@
 
@@ -130,6 +175,20 @@
return MAL_SUCCEED;
 }
 
+str 
+ZORDdecode_int_oid_x(int *x, oid *z)
+{
+   Zdecode_int_oid_x(x,z);
+   return MAL_SUCCEED;
+}
+
+str 
+ZORDdecode_int_oid_y(int *y, oid *z)
+{
+   Zdecode_int_oid_y(y,z);
+   return MAL_SUCCEED;
+}
+
 str
 ZORDbatencode_int_oid(int *zbid, int *xbid, int *ybid)
 {
@@ -291,6 +350,116 @@
return MAL_SUCCEED;
 }
 
+str
+ZORDbatdecode_int_oid_x(int *xbid, int *zbid)
+{
+   BAT *bx,*bz;
+   oid *z, *q;
+   int *x;
+
+   bz = BATdescriptor(*zbid);
+   if ( bz == 0 )
+   throw(OPTIMIZER, "zorder.decode", RUNTIME_OBJECT_MISSING);
+   
+   bx = BATnew(TYPE_void, TYPE_int, BATcount(bz));
+   if ( bx == 0 ){
+   BBPunfix(bz->batCacheid);
+   throw(OPTIMIZER, "zorder.decode", RUNTIME_OBJECT_MISSING);
+   }
+   
+   z = (oid *) Tloc(bz, BUNfirst(bz));
+   q = (oid *) Tloc(bz, BUNlast(bz));
+   x = (int *) Tloc(bx, BUNfirst(bx));
+
+   BATaccessBegin(bz, USE_TAIL, MMAP_SEQUENTIAL);
+   if ( bz->T->nonil ){
+   for ( ; zbatDirty&2)) 
+   bx = BATsetaccess(bx, BAT_READ);
+   BATsetcount(bx, BATcount(bz));
+   BATseqbase(bx, bz->hseqbase);
+   bx->hsorted = 1;
+   bx->tsorted = 0;
+   bx->H->nonil = 1;
+   bx->T->nonil = bz->T->nonil;
+
+   if (bx->htype != bz->htype) {
+BAT *r = VIEWcreate(bz,bx);
+BBPreleaseref(bx->batCacheid);
+bx = r;
+}
+
+   BBPunfix(bz->batCacheid);
+   BBPkeepref(*xb

Re: MonetDB: default - [mq]: zorder.patch

2010-08-05 Thread Ying Zhang

On Aug 06, 2010, at 00:13 , Jennie Zhang wrote:

> Changeset: c9bb76c454ec for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9bb76c454ec
> Modified Files:
>   MonetDB5/src/modules/mal/Tests/zorder.mal
>   MonetDB5/src/modules/mal/zorder.mx
> Branch: default
> Log Message:
> 
> [mq]: zorder.patch


I forgot to add a log message to 'hg qfinish' and could not find a way to add 
it afterward, so adding it this way:

zorder xy -> {xy,x,y}
- extended the zorder module with (MAL) commands to extract only the 
x/y-coordinates from a z-order encoding
- added tests for the new commands


> 
> 
> diffs (237 lines):
> 
> diff -r e9d9b58d5f1e -r c9bb76c454ec MonetDB5/src/modules/mal/Tests/zorder.mal
> --- a/MonetDB5/src/modules/mal/Tests/zorder.mal   Thu Aug 05 16:56:34 
> 2010 +0200
> +++ b/MonetDB5/src/modules/mal/Tests/zorder.mal   Thu Aug 05 17:06:49 
> 2010 +0200
> @@ -21,6 +21,15 @@
> (x,y):= zorder.decode(z3); io.print(x,y);
> (x,y):= zorder.decode(z4); io.print(x,y);
> 
> +x := zorder.decode_x(z1);
> +y := zorder.decode_y(z1); io.print(x, y);
> +x := zorder.decode_x(z2);
> +y := zorder.decode_y(z2); io.print(x, y);
> +x := zorder.decode_x(z3);
> +y := zorder.decode_y(z3); io.print(x, y);
> +x := zorder.decode_x(z4);
> +y := zorder.decode_y(z4); io.print(x, y);
> +
> bx:= bat.new(:oid,:int);
> bat.append(bx,0);
> bat.append(bx,1);
> @@ -62,6 +71,9 @@
> io.print(bz);
> (cx,cy):= zorder.decode(bz);
> io.print(cx,cy);
> +dx:= zorder.decode_x(bz);
> +dy:= zorder.decode_y(bz);
> +io.print(dx,dy);
> 
> # taking a slice
> bs:= zorder.slice(1,1,3,3);
> diff -r e9d9b58d5f1e -r c9bb76c454ec MonetDB5/src/modules/mal/zorder.mx
> --- a/MonetDB5/src/modules/mal/zorder.mx  Thu Aug 05 16:56:34 2010 +0200
> +++ b/MonetDB5/src/modules/mal/zorder.mx  Thu Aug 05 17:06:49 2010 +0200
> @@ -49,6 +49,22 @@
> address ZORDbatdecode_int_oid
> comment "Derive the z-order pair";
> 
> +command decode_x(z:oid)(x:int)
> +address ZORDdecode_int_oid_x
> +comment "Derive the z-order x-coordinate";
> +
> +command decode_x(z:bat[:oid,:oid]):bat[:oid,:int]
> +address ZORDbatdecode_int_oid_x
> +comment "Derive the z-order x-coordinate";
> +
> +command decode_y(z:oid)(y:int)
> +address ZORDdecode_int_oid_y
> +comment "Derive the z-order y-coordinate";
> +
> +command decode_y(z:bat[:oid,:oid]):bat[:oid,:int]
> +address ZORDbatdecode_int_oid_y
> +comment "Derive the z-order y-coordinate";
> +
> command slice(xb:int, yb:int, xt:int, yt:int ):bat[:oid,:oid]
> address ZORDslice_int
> comment "Extract the Z-order indices between two points";
> @@ -71,7 +87,11 @@
> zorder_export str ZORDencode_int_oid(oid *z, int *x, int *y);
> zorder_export str ZORDbatencode_int_oid(int *z, int *x, int *y);
> zorder_export str ZORDdecode_int_oid(int *x, int *y, oid *z);
> +zorder_export str ZORDdecode_int_oid_x(int *x, oid *z);
> +zorder_export str ZORDdecode_int_oid_y(int *y, oid *z);
> zorder_export str ZORDbatdecode_int_oid(int *x, int *y, int *z);
> +zorder_export str ZORDbatdecode_int_oid_x(int *x, int *z);
> +zorder_export str ZORDbatdecode_int_oid_y(int *y, int *z);
> zorder_export str ZORDslice_int(int *r, int *xb, int *yb, int *xt, int *yt);
> 
> #endif /* _ZORDER_H */
> @@ -113,6 +133,31 @@
>   *x = xv;
>   *y = yv;
> }
> +static inline void zdeco...@1_@2_x(@1 *x, @2 *z)
> +{
> + @1 xv = 0, mask =1;
> + @2 zv = *z;
> + int i;
> + for ( i = 0; i < (int) (8 * sizeof(@2)); i+= 2) {
> + xv |= ((zv & 1) * mask);
> + zv >>= 2;
> + mask <<=1;
> + }
> + *x = xv;
> +}
> +static inline void zdeco...@1_@2_y(@1 *y, @2 *z)
> +{
> + @1 yv=0, mask =1;
> + @2 zv = *z;
> + int i;
> + for ( i = 0; i < (int) (8 * sizeof(@2)); i+= 2) {
> + zv >>= 1;
> + yv |= ((zv & 1) * mask);
> + zv >>= 1;
> + mask <<=1;
> + }
> + *y = yv;
> +}
> @c
> @:Zcode(int,oid)@
> 
> @@ -130,6 +175,20 @@
>   return MAL_SUCCEED;
> }
> 
> +str 
> +ZORDdecode_int_oid_x(int *x, oid *z)
> +{
> + Zdecode_int_oid_x(x,z);
> + return MAL_SUCCEED;
> +}
> +
> +str 
> +ZORDdecode_int_oid_y(int *y, oid *z)
> +{
> + Zdecode_int_oid_y(y,z);
> + return MAL_SUCCEED;
> +}
> +
> str
> ZORDbatencode_int_oid(int *zbid, int *xbid, int *ybid)
> {
> @@ -291,6 +350,116 @@
>   return MAL_SUCCEED;
> }
> 
> +str
> +ZORDbatdecode_int_oid_x(int *xbid, int *zbid)
> +{
> + BAT *bx,*bz;
> + oid *z, *q;
> + int *x;
> +
> + bz = BATdescriptor(*zbid);
> + if ( bz == 0 )
> + throw(OPTIMIZER, "zorder.decode", RUNTIME_OBJECT_MISSING);
> + 
> + bx = BATnew(TYPE_void, TYPE_int, BATcount(bz));
> + if ( bx == 0 ){
> + BBPunfix(bz->batCacheid);
> + throw(OPTIMIZER, "zorder.decode", RUNTIME_OBJECT_MISSING);
> + }
> + 
> + z = (oid *) Tloc(bz, BUNfirst(bz));
> + q = (oid *) Tloc(bz, BUNlast(bz));
> + x = (int *) Tloc(bx, BUNfirst(bx));
> +
> + BATaccessBe