[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: sql_profiler - Mark location profiler calls for query c...
From:       Aris_Koning <commits+aris.koning=monetdbsolutions.com () monetdb ! o
Date:       2022-06-27 14:49:24
Message-ID: hg.242e831d1585.1656341364.-6541620434645813117 () dev ! monetdb ! org
[Download RAW message or body]

Changeset: 242e831d1585 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/242e831d1585
Modified Files:
	sql/backends/monet5/sql.c
	sql/backends/monet5/sql_scenario.c
Branch: sql_profiler
Log Message:

Mark location profiler calls for query compilation related events.


diffs (57 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -128,7 +128,9 @@ sql_symbol2relation(backend *be, symbol 
 	int value_based_opt = be->mvc->emode != m_prepare, storage_based_opt;
 	int profile = be->mvc->emode == m_plan;
 
+	// TODO PROFILER EVENT: start of SQL compilation,i.e. parse tree to relation.: log \
be->client->curprg->def->tag  rel = rel_semantic(query, sym);
+	// TODO PROFILER EVENT: end of SQL compilation,i.e. parse tree to relation and \
start of relational optimizer: log be->client->curprg->def->tag  storage_based_opt = \
value_based_opt && rel && !is_ddl(rel->op);  Tbegin = GDKusec();
 	if (rel)
@@ -138,6 +140,8 @@ sql_symbol2relation(backend *be, symbol 
 	if (rel && (rel_no_mitosis(be->mvc, rel) || rel_need_distinct_query(rel)))
 		be->no_mitosis = 1;
 	be->reloptimizer = GDKusec() - Tbegin;
+
+	// TODO PROFILER EVENT: end of relational optimizer: log \
be->client->curprg->def->tag  return rel;
 }
 
diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -1109,7 +1109,7 @@ SQLparser(Client c)
 	tag = runtimeProfileSetTag(c);
 	assert(tag == c->curprg->def->tag);
 	(void) tag;
-	// TODO PROFILER EVENT: start of sql parsing is start of sql compilation
+	// TODO PROFILER EVENT: start of sql parsing is start of sql compilation: log \
c->curprg->def->tag  
 	if ((err = sqlparse(m)) ||
 	    /* Only forget old errors on transaction boundaries */
@@ -1194,10 +1194,12 @@ SQLparser(Client c)
 				}
 			}
 
+			// TODO PROFILER EVENT: start of relation to MAL compilation: log \
c->curprg->def->tag  if (backend_dumpstmt(be, c->curprg->def, r, !(m->emod & \
mod_exec), 0, c->query) < 0)  err = 1;
 			else
 				opt = (m->emod & mod_exec) == 0;//1;
+			// TODO PROFILER EVENT: end of relation to MAL compilation: log \
c->curprg->def->tag and err if present.  } else {
 			char *q_copy = sa_strdup(m->sa, c->query);
 
@@ -1275,7 +1277,9 @@ SQLparser(Client c)
 
 		/* in case we had produced a non-cachable plan, the optimizer should be called */
 		if (msg == MAL_SUCCEED && opt ) {
+			// TODO PROFILER EVENT: start of MAL optimizer. log c->curprg->def->tag
 			msg = SQLoptimizeQuery(c, c->curprg->def);
+			// TODO PROFILER EVENT: end  of MAL optimizer. log c->curprg->def->tag and error \
if so  
 			if (msg != MAL_SUCCEED) {
 				str other = c->curprg->def->errors;
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-leave@monetdb.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic