2012年6月15日,作者: 杰克·范瓦斯(Jack Vamvas)
DBA的目标之一是降低查询成本。降低查询成本–提高整体性能。 db2advis建议 查询索引。
Read the post - 波克斗地主调优工具包– db2expln -分析 特定的访问路径 query.
语法 和过程示例:
步骤1 –创建源文件
Put a 在名为index.sql的输入文件中查询。这只是一个示例查询
select SUBSTR(TBNAME,1,40), SUBSTR(TBCREATOR,1,10), substr(name,1,30), SUBSTR(CREATOR,1,8),substr(colnames,1,60), firstkeycard, fullkeycard, sequential_pages, density, iid, uniquerule, stats_time, colnames from sysibm.sysindexes a ORDER BY tbcreator, TBNAME, NAME;
第2步 执行db2advis命令
db2advis -d myDB -i 在 dex.sql
如果看到错误消息:
说明未针对模式MYINST正确设置表
插入ADVISE_INSTANCE表失败。
顾问评估了0个解决方案
退出,错误代码为[-219]
为了解决这个问题,我执行 db2 -tvf<instance_home>\ sqllib \ misc \ EXPLAIN.DDL
一个典型的回应。
execution started at timestamp 2012-06-15-11.58.47.685111 found [1] SQL statements from the 在 put file Recommending 在 dexes... 0 在 dexes 在 current solution [140.1555] timerons (without recommendations) [140.1555] timerons (with current solution) [0.00%] improvement -- -- -- LIST OF RECOMMENDED INDEXES -- =========================== -- no 在 dexes are recommended for this workload. -- -- -- RECOMMENDED EXISTING INDEXES -- ============================ -- -- -- UNUSED EXISTING INDEXES -- ============================ -- =========================== -- -- ====ADVISOR DETAILED XML OUTPUT============= -- ==(Benefits do not 在 clude clustering recommendations)== -- -- -- -- --0 -- -- select SUBSTR(TBNAME,1,40), SUBSTR(TBCREATOR,1,10), substr(name,1,30), SUBSTR(CREATOR,1,8),substr(colnames,1,60), -- firstkeycard, fullkeycard, sequential_pages, density, from sysibm.sysindexes s_time, colnames - a WHERE density = 1 AND iid = 3 -- -- --0.000000 --1 -- -- -- ====ADVISOR DETAILED XML OUTPUT============= -- 顾问评估了0个解决方案 波克斗地主 Workload 性能 Advisor tool is finished.
Posted by: |