A simple SELECT query

From MonetDB
Jump to navigationJump to search

The Table[edit]

CREATE TABLE "tpch"."region" ( "r_regionkey" INTEGER NOT NULL, "r_name" VARCHAR(25) NOT NULL, "r_comment" VARCHAR(152) NOT NULL );

The Query[edit]

SELECT r_name from region;

The MAL[edit]

+------------------------------------------------------------------------+
| mal                                                                    |
+========================================================================+
| function user.s9_1{autoCommit=true}():void;                            |
| barrier X_36 := language.dataflow();                                   |
|     X_2 := sql.mvc();                                                  |
|     X_3:bat[:oid,:oid]  := sql.tid(X_2,"tpch","region");               |
|     X_6 := sql.bind(X_2,"tpch","region","r_name",0);                   |
|     (X_9,r1_9) := sql.bind(X_2,"tpch","region","r_name",2);            |
|     X_12 := sql.bind(X_2,"tpch","region","r_name",1);                  |
|     X_14 := sql.delta(X_6,X_9,r1_9,X_12);                              |
|     X_15 := algebra.leftfetchjoin(X_3,X_14);                           |
| exit X_36;                                                             |
|     X_16 := sql.resultSet(1,1,X_15);                                   |
|     sql.rsColumn(X_16,"tpch.region","r_name","varchar",25,0,X_15);     |
|     X_21 := io.stdout();                                               |
|     sql.exportResult(X_21,X_16);                                       |
| end s9_1;                                                              |
| # querylog.define("explain select r_name from region;","default_pipe") |
+------------------------------------------------------------------------+