How to work with MAL-statements?
Hello, to improve execution time I wanted to work with MAL-statements, so that I could directly control the query plan. But it seems that the generated MAL-Plans don`t „just work“ when I type them. I tried to get used to MAL with the simple query „select * from table;“. This got me the following plan: function user.s1_1{autoCommit=true}():void; barrier X_59 := language.dataflow(); X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","diseases"); X_6:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",0); (X_9,r1_9) := sql.bind(X_2,"sys","diseases","id",2); X_12:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",1); X_14 := sql.delta(X_6,X_9,r1_9,X_12); X_15 := algebra.leftfetchjoin(X_3,X_14); X_23:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",0); (X_25,r1_25) := sql.bind(X_2,"sys","diseases","name",2); X_27:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",1); X_28 := sql.delta(X_23,X_25,r1_25,X_27); X_29 := algebra.leftfetchjoin(X_3,X_28); X_16:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",0); (X_18,r1_18) := sql.bind(X_2,"sys","diseases","short_name",2); X_20:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",1); X_21 := sql.delta(X_16,X_18,r1_18,X_20); X_22 := algebra.leftfetchjoin(X_3,X_21); language.pass(X_3); exit X_59; X_30 := sql.resultSet(3,1,X_15); sql.rsColumn(X_30,"sys.diseases","id","int",32,0,X_15); sql.rsColumn(X_30,"sys.diseases","short_name","varchar",255,0,X_22); sql.rsColumn(X_30,"sys.diseases","name","varchar",255,0,X_29); X_40 := io.stdout(); sql.exportResult(X_40,X_30); end s1_1; But when I try to run this statements I get the following error: MAPI = (monetdb) /tmp/.s.monetdb.5250 QUERY = end s1_1; ERROR = !TypeException:user.s1_1[7]:'sql.delta' undefined in: X_14:any := sql.delta(X_6:bat[:oid,:int], X_9:bat[:oid,:oid], r1_9:bat[:oid,:any], X_12:bat[:oid,:int]) !ERROR: MSresetVariablescould not allocate space for What am I`m missing that it doesn`t work? Kind regards, Martin
Indeed, MAL is not the level you should program at all. In recent release the rendering is aimed at debugging and it it is not directly useful for modification. regards, Martin On 22/07/15 13:57, Martin Schwitalla wrote:
Hello,
to improve execution time I wanted to work with MAL-statements, so that I could directly control the query plan. But it seems that the generated MAL-Plans don`t „just work“ when I type them.
I tried to get used to MAL with the simple query „select * from table;“. This got me the following plan:
function user.s1_1{autoCommit=true}():void; barrier X_59 := language.dataflow(); X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","diseases"); X_6:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",0); (X_9,r1_9) := sql.bind(X_2,"sys","diseases","id",2); X_12:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",1); X_14 := sql.delta(X_6,X_9,r1_9,X_12); X_15 := algebra.leftfetchjoin(X_3,X_14); X_23:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",0); (X_25,r1_25) := sql.bind(X_2,"sys","diseases","name",2); X_27:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",1); X_28 := sql.delta(X_23,X_25,r1_25,X_27); X_29 := algebra.leftfetchjoin(X_3,X_28); X_16:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",0); (X_18,r1_18) := sql.bind(X_2,"sys","diseases","short_name",2); X_20:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",1); X_21 := sql.delta(X_16,X_18,r1_18,X_20); X_22 := algebra.leftfetchjoin(X_3,X_21); language.pass(X_3); exit X_59; X_30 := sql.resultSet(3,1,X_15); sql.rsColumn(X_30,"sys.diseases","id","int",32,0,X_15); sql.rsColumn(X_30,"sys.diseases","short_name","varchar",255,0,X_22); sql.rsColumn(X_30,"sys.diseases","name","varchar",255,0,X_29); X_40 := io.stdout(); sql.exportResult(X_40,X_30); end s1_1;
But when I try to run this statements I get the following error:
MAPI = (monetdb) /tmp/.s.monetdb.5250 QUERY = end s1_1; ERROR = !TypeException:user.s1_1[7]:'sql.delta' undefined in: X_14:any := sql.delta(X_6:bat[:oid,:int], X_9:bat[:oid,:oid], r1_9:bat[:oid,:any], X_12:bat[:oid,:int]) !ERROR: MSresetVariablescould not allocate space for
What am I`m missing that it doesn`t work?
Kind regards, Martin
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
Hi Martin, so you would say that I should forget my idea as fast as possible? ;) But what possibilities do I have to control the query plan? Only through SQL? But this gets optimized by your Query Optimizer and I think this approach is limited. Or should I try to alter you source code? Martin
Am 22.07.2015 um 14:22 schrieb Martin Kersten
: Indeed, MAL is not the level you should program at all. In recent release the rendering is aimed at debugging and it it is not directly useful for modification. regards, Martin On 22/07/15 13:57, Martin Schwitalla wrote:
Hello,
to improve execution time I wanted to work with MAL-statements, so that I could directly control the query plan. But it seems that the generated MAL-Plans don`t „just work“ when I type them.
I tried to get used to MAL with the simple query „select * from table;“. This got me the following plan:
function user.s1_1{autoCommit=true}():void; barrier X_59 := language.dataflow(); X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","diseases"); X_6:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",0); (X_9,r1_9) := sql.bind(X_2,"sys","diseases","id",2); X_12:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",1); X_14 := sql.delta(X_6,X_9,r1_9,X_12); X_15 := algebra.leftfetchjoin(X_3,X_14); X_23:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",0); (X_25,r1_25) := sql.bind(X_2,"sys","diseases","name",2); X_27:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",1); X_28 := sql.delta(X_23,X_25,r1_25,X_27); X_29 := algebra.leftfetchjoin(X_3,X_28); X_16:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",0); (X_18,r1_18) := sql.bind(X_2,"sys","diseases","short_name",2); X_20:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",1); X_21 := sql.delta(X_16,X_18,r1_18,X_20); X_22 := algebra.leftfetchjoin(X_3,X_21); language.pass(X_3); exit X_59; X_30 := sql.resultSet(3,1,X_15); sql.rsColumn(X_30,"sys.diseases","id","int",32,0,X_15); sql.rsColumn(X_30,"sys.diseases","short_name","varchar",255,0,X_22); sql.rsColumn(X_30,"sys.diseases","name","varchar",255,0,X_29); X_40 := io.stdout(); sql.exportResult(X_40,X_30); end s1_1;
But when I try to run this statements I get the following error:
MAPI = (monetdb) /tmp/.s.monetdb.5250 QUERY = end s1_1; ERROR = !TypeException:user.s1_1[7]:'sql.delta' undefined in: X_14:any := sql.delta(X_6:bat[:oid,:int], X_9:bat[:oid,:oid], r1_9:bat[:oid,:any], X_12:bat[:oid,:int]) !ERROR: MSresetVariablescould not allocate space for
What am I`m missing that it doesn`t work?
Kind regards, Martin
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
Hi - the cut/paste/execute of MAL listings should be fixed - MAL is certainly not the level where you tinker with plans, unless you are building specific MAL optimizers or new functionality - In your case, I would first consider taking the lessons and see if the application producing this wieldy SQL code can be improved. regards, Martin On 22/07/15 14:31, Martin Schwitalla wrote:
Hi Martin,
so you would say that I should forget my idea as fast as possible? ;) But what possibilities do I have to control the query plan? Only through SQL? But this gets optimized by your Query Optimizer and I think this approach is limited. Or should I try to alter you source code?
Martin
Am 22.07.2015 um 14:22 schrieb Martin Kersten
: Indeed, MAL is not the level you should program at all. In recent release the rendering is aimed at debugging and it it is not directly useful for modification. regards, Martin On 22/07/15 13:57, Martin Schwitalla wrote:
Hello,
to improve execution time I wanted to work with MAL-statements, so that I could directly control the query plan. But it seems that the generated MAL-Plans don`t „just work“ when I type them.
I tried to get used to MAL with the simple query „select * from table;“. This got me the following plan:
function user.s1_1{autoCommit=true}():void; barrier X_59 := language.dataflow(); X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","diseases"); X_6:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",0); (X_9,r1_9) := sql.bind(X_2,"sys","diseases","id",2); X_12:bat[:oid,:int] := sql.bind(X_2,"sys","diseases","id",1); X_14 := sql.delta(X_6,X_9,r1_9,X_12); X_15 := algebra.leftfetchjoin(X_3,X_14); X_23:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",0); (X_25,r1_25) := sql.bind(X_2,"sys","diseases","name",2); X_27:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","name",1); X_28 := sql.delta(X_23,X_25,r1_25,X_27); X_29 := algebra.leftfetchjoin(X_3,X_28); X_16:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",0); (X_18,r1_18) := sql.bind(X_2,"sys","diseases","short_name",2); X_20:bat[:oid,:str] := sql.bind(X_2,"sys","diseases","short_name",1); X_21 := sql.delta(X_16,X_18,r1_18,X_20); X_22 := algebra.leftfetchjoin(X_3,X_21); language.pass(X_3); exit X_59; X_30 := sql.resultSet(3,1,X_15); sql.rsColumn(X_30,"sys.diseases","id","int",32,0,X_15); sql.rsColumn(X_30,"sys.diseases","short_name","varchar",255,0,X_22); sql.rsColumn(X_30,"sys.diseases","name","varchar",255,0,X_29); X_40 := io.stdout(); sql.exportResult(X_40,X_30); end s1_1;
But when I try to run this statements I get the following error:
MAPI = (monetdb) /tmp/.s.monetdb.5250 QUERY = end s1_1; ERROR = !TypeException:user.s1_1[7]:'sql.delta' undefined in: X_14:any := sql.delta(X_6:bat[:oid,:int], X_9:bat[:oid,:oid], r1_9:bat[:oid,:any], X_12:bat[:oid,:int]) !ERROR: MSresetVariablescould not allocate space for
What am I`m missing that it doesn`t work?
Kind regards, Martin
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (3)
-
Martin Kersten
-
Martin Kersten
-
Martin Schwitalla