MonetDB: default - Toptimize doesn't measure anything usefull, i...

Martin Kersten Martin.Kersten at cwi.nl
Wed Mar 20 14:23:57 CET 2013


I agree, was looking at it as well.
Idea was take the time of all optimizers together.

sql>call querylog_enable();
sql>select * from querylog_catalog();
+----+-------+---------+-------+------+-----+----------+
| id | owner | defined | query | pipe | mal | optimize |
+====+=======+=========+=======+======+=====+==========+
+----+-------+---------+-------+------+-----+----------+
0 tuples (1.752ms)
sql>call querylog_enable();
sql>select count(*) from tables;
+------+
| L1   |
+======+
|   33 |
+------+
1 tuple (3.112ms)
sql>select * from querylog_catalog();
+-----------+---------+----------------------------+------------------------------+--------------+------+----------+
| id        | owner   | defined                    | query 
           | pipe         | mal  | optimize |
+===========+=========+============================+==============================+==============+======+==========+
| 1359324 at 0 | monetdb | 2013-03-20 13:22:14.000000 | select count(*) 
from tables; | default_pipe |   54 | 69124831 |
+-----------+---------+----------------------------+------------------------------+--------------+------+----------+
1 tuple (1.740ms)
sql>select * from querylog_calls();
+-----------+----------------------------+----------------------------+--------------+--------+------+------+------+------+-------+
| id        | start                      | stop                       | 
arguments    | tuples | run  | ship | cpu  | io   | space |
+===========+============================+============================+==============+========+======+======+======+======+=======+
| 1359324 at 0 | 2013-03-20 13:22:14.000000 | 2013-03-20 13:22:14.000000 | 
user.s3_1(); |      1 |  742 |   14 |    0 |    0 |     0 |
+-----------+----------------------------+----------------------------+--------------+--------+------+------+------+------+-------+


On 3/20/13 2:21 PM, Niels Nes wrote:
> Changeset: 6bd79fe72615 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6bd79fe72615
> Modified Files:
> 	monetdb5/mal/mal_runtime.c
> 	sql/backends/monet5/sql_gencode.c
> Branch: default
> Log Message:
>
> Toptimize doesn't measure anything usefull, ie just store 0 for the time
> being (solves all problems with changing output). We need a different
> solution to store the time spend in the optimizer stack.
>
>
> diffs (34 lines):
>
> diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
> --- a/monetdb5/mal/mal_runtime.c
> +++ b/monetdb5/mal/mal_runtime.c
> @@ -172,8 +172,8 @@ runtimeProfileExit(Client cntxt, MalBlkP
>   	if (malProfileMode == 0)
>   		return; /* mostly true */
>
> -	if (stk != NULL && prof->stkpc >= 0 && mb->profiler != NULL && mb->profiler[stkpc].trace && mb->profiler[stkpc].clk)
> -	{
> +	if (stk != NULL && prof->stkpc >= 0 && mb->profiler != NULL &&
> +		mb->profiler[stkpc].trace && mb->profiler[stkpc].clk) {
>   		MT_lock_set(&mal_contextLock, "sysmon");
>   		gettimeofday(&mb->profiler[stkpc].clock, NULL);
>   		mb->profiler[stkpc].counter++;
> diff --git a/sql/backends/monet5/sql_gencode.c b/sql/backends/monet5/sql_gencode.c
> --- a/sql/backends/monet5/sql_gencode.c
> +++ b/sql/backends/monet5/sql_gencode.c
> @@ -2408,7 +2408,7 @@ backend_dumpproc(backend *be, Client c,
>   	{
>   		char *t;
>   		InstrPtr q;
> -		lng Toptimize = GDKusec();
> +		lng Toptimize = 0;
>
>   		if ( be->q && be->q->codestring) {
>   			t = GDKstrdup(  be->q->codestring);
> @@ -2421,7 +2421,6 @@ backend_dumpproc(backend *be, Client c,
>   		q->token = REMsymbol;	// will be patched
>   		q = pushStr(mb, q, t);
>   		q = pushStr(mb, q, pipe= initSQLoptimizer());
> -		Toptimize = GDKusec() - Toptimize;
>   		(void) pushLng(mb, q, Toptimize);
>   		m->Tparse = 0;
>   		GDKfree(pipe);
> _______________________________________________
> checkin-list mailing list
> checkin-list at monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
>



More information about the developers-list mailing list