[Monetdb-developers] working with the SQL engine's MAL explanations

Isidor Zeuner monetdb at quidecco.de
Sat Feb 13 17:22:32 CET 2010


Dear MonetDB developers,

when using the EXPLAIN keyword within "mclient --language=sql", I get
output like:

% .explain # table_name
% mal # name
% clob # type
% 0 # length
function user.s0_2{autoCommit=true}():void;
..
..

Most notably, apart from the lines starting with %, the syntax
resembles the code "mclient --language=mal" would expect. So, a naive
approach to use this observation would be to filter out the % lines
and feed the output together with some boilerplate code into "mclient
--language=mal" (example using a bash unix shell):

echo "EXPLAIN SELECT 1;"|
mclient --language=sql|
(
echo "sql.init();"
grep -v ^%
echo "user.s0_2();"
)|
mclient --language=mal

For very simple SQL statements, this works and creates the expected
output. However, as soon as tables come into play, I'm getting
errors because of uninitialized variables. So there seem to be at
least semantical differences between EXPLAIN's MAL output and the
MAL "mclient --language=mal" expects. Is this difference documented
somewhere? Is there a better way for ad-hoc translation from
executable SQL to executable MAL?

Best regards,

Isidor Zeuner




More information about the developers-list mailing list