DB2查看执行计划
在DB2中查看sql的执行计划没有其它数据库方便,需要经过好几步,这里我把步骤整理成shell脚本以方便使用,如下:
#!/bin/sh
 
db2 connect to <db>
db2 -tvf $HOME/sqllib/misc/EXPLAIN.DDL
db2 set current explain mode explain
 
db2 "
<sql>
"
 
db2 set current explain mode no
 
db2exfmt -d <db> -g TIC -w -l -s % -n % -o explain.out
使用时需要替换掉脚本中的db和sql
相关推荐
  wintershii    2020-06-11  
   thunderstorm    2020-04-22  
   hxw0    2020-04-15  
   airfling    2020-02-19  
   JokerFei    2019-12-25  
   qiaoqiangv    2008-01-10  
   fairystepwgl    2016-03-22  
   WilliamLin    2014-05-10  
   zhaohuan    2019-08-13  
   Enn的数据库    2012-03-14  
   helloworlddm    2011-07-21  
   DataCastle    2014-03-17  
   spprogrammer    2016-03-22  
   linminqin    2011-11-25  
   learningoracle    2011-09-17  
   WilliamLin    2009-12-14  
   liumin    2019-06-29  
 