MonetDB的SQL手册——Explain(执行计划)
来源:互联网 发布:js设置option选中 编辑:程序博客网 时间:2024/06/11 01:21
EXPLAIN SQL STMT
Explain语句
The intermediate code produced by the SQL compiler can be made visible using theexplain statement modifier. It gives a detailed description of the actions taken to produce the answer. The example below illustrates what you can expect when a simple query is prepended by theexplain modifier.The output strongly depends on the optimizer pipeline. The details of this program are better understood when you have read the MAL reference.
可以用Explain语句查看SQL编译器产生的中间代码。它给出了详细处理过程的动作描述。下面是展示的是一个例子。输出依赖于优化器的设置。
sql>select count(*) from tables;+--------+| count_ |+========+| 27 |+--------+sql>explain select count(*) from tables;+---------------------------------------------------------------------------------------------+| mal |+=============================================================================================+| function user.s3_2{autoCommit=true}():void; || _2 := sql.mvc(); || barrier _143 := language.dataflow(); || _23:bat[:oid,:sht] := sql.bind(_2,"sys","_tables","type",1); || _24 := algebra.thetauselect(_23,2:sht,"<"); || _25:bat[:oid,:oid] := sql.bind_dbat(_2,"sys","_tables",1); || _27 := bat.reverse(_25); || _97 := algebra.kdifference(_24,_27); || _110 := algebra.markT(_97,5,4); || _117 := bat.reverse(_110); || _30:bat[:oid,:int] := sql.bind(_2,"sys","_tables","id",1); || _142 := algebra.leftjoin(_117,_30); || _64:bat[:oid,:sht] := sql.bind(_2,"sys","_tables","type",0,27@0,nil:oid); || _72 := algebra.thetauselect(_64,2:sht,"<"); || _20:bat[:oid,:sht] := sql.bind(_2,"sys","_tables","type",2); || _76 := algebra.kdifference(_72,_20); || _22 := algebra.thetauselect(_20,2:sht,"<"); || _80 := algebra.semijoin(_22,_64); || _85 := algebra.kunion(_76,_80); |...| _13 := algebra.kdifference(_8,_12); || _14 := algebra.markT(_13,0@0); || _15 := bat.reverse(_14); || _16:bat[:oid,:int] := sql.bind(_2,"tmp","_tables","id",0); || _18 := algebra.leftjoin(_15,_16); || exit _143; || _33:bat[:oid,:int] := bat.new(nil:oid,nil:int); || barrier _146 := language.dataflow(); || _32 := mat.pack(_134,_136,_138,_140,_142); || _36 := bat.append(_33,_32,true); || _38 := bat.append(_36,_18,true); || _39 := aggr.count(_38); || exit _146; || sql.exportValue(1,".tables","L6","wrd",64,0,6,_39,""); || end s3_2; |+---------------------------------------------------------------------------------------------+86 tuplessql>
The SQL compiler maintains a cache of compiled queries. Each query is looked up in this cache based on an expression pattern match where the constants may take on different values. If it doesn't exist, the query is converted into a code block and stored in the module user.s0.
The call to the cached function is included in a wrapper function main, which is the only piece of code produced if the query is used more than once. The query cache disappears when the server is brought to a halt.
SQL编译陪存储在内存的cache中。每个查询检察cache,如果模式没有匹配,则查询传唤为代码存储在模行程 user.s0
+----------------------------+ | function user.main():void; | | mdb.start(); | | user.s3_2(); | | mdb.stop(); | | end main; | +----------------------------+
- MonetDB的SQL手册——Explain(执行计划)
- MonetDB的SQL手册——Trace子句
- TOAD中查看SQL的执行计划(Explain Plan)
- explain plan获取sql的执行计划
- 【Explain Plan】查看SQL的执行计划
- 【Explain Plan】查看SQL的执行计划
- EXPLAIN分析SQL的执行计划
- MySQL——EXPLAIN和执行计划
- sql:常用sql查询工具五(explain 执行计划)
- .mysql的SQL语句执行计划分析:EXPLAIN
- Mysql通过EXPLAIN 分析低效SQL 的执行计划
- mysql explain分析sql语句的执行计划
- mysql的SQL语句执行计划分析:EXPLAIN
- mysql explain查看sql语句的执行计划
- 执行计划的使用(EXPLAIN)
- 执行计划的使用(EXPLAIN)
- Mysql的执行计划explain
- MySQL的EXPLAIN执行计划
- jQuery插件的编写相关技术 设计总结和最佳实践
- 【吃一堑】vector的pop_back使用错误造成的core dump
- 什么是CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI?
- No object in the CompoundRoot has a publicly accessible property named
- 字节、字、bit、byte的关系
- MonetDB的SQL手册——Explain(执行计划)
- 范数
- 黑马程序员_Java基础语法1
- Android之PopupWindow弹出对话框
- Deserialize XML data into object
- hdu 1828 Picture(扫描线)
- 关于Nginx session sticky
- Xcode中禁用单个类文件不使用ARC
- Documentation/devicetree/bindings/xilinx.txt