執行SQL前,先執行下列
SET EXPLAIN ON , 開啟執行計劃, 要整個跑完後才能看
SET EXPLAIN OFF, 關閉執行計劃
SET EXPLAIN ON AVOID_EXECUTE, 開始執行計劃,但只評估不執行
所以查看SQL 用到index的狀況,可選擇第3種方式
詳細使用可查看informix online help
完成後會輸出到 sqexplain.out
vi 查看內容如下
QUERY:
------
select * from test
Estimated Cost: 453
Estimated # of Rows Returned: 8835
1) xxxx.test: SEQUENTIAL SCAN
QUERY:
------
select * from ss_code
Estimated Cost: 453
Estimated # of Rows Returned: 8835
1) xxxx.test: SEQUENTIAL SCAN
~
~
"sqexplain.out" 21 lines, 263 characters
沒有留言:
張貼留言