where 函数问题引起执行计划改变(复杂视图)
来源:互联网 发布:郑州市大数据产业园 编辑:程序博客网 时间:2024/06/05 08:15
使用函数非常慢,使用变量很快
FROM v_hldtotal_price a,
v_balance_price b,
v_hlddetail_price c,
v_symbol_price d
WHERE a.t_date = b.t_date
AND a.t_date = c.t_date
AND a.t_date = d.t_date
AND a.f_code = b.f_code
AND a.f_code = c.f_code
AND a.f_code = d.f_code
AND a.f_code = :fcode
AND a.t_date = fun_date_start_last_end (:YEAR, :num, :style, :fcode)
修改办法:釜底抽薪
explain plan for SELECT nvl (a.a701, 0) AS a701, nvl (a.a604, 0) AS a604,
nvl (c.a100201, 0) AS a100201, nvl (d.bb, 0) AS bb,
nvl (d.bc, 0) AS bc, nvl (d.fbd, 0) AS fbd,
(nvl (b.a601102, 0) + nvl (b.a610103, 0)) AS zchzq, nvl (d.e, 0) AS e,
nvl (d.feq, 0) AS feq, 0 other_qyzc, nvl (c.a2202, 0) AS a2202
FROM (select * from TYDW.V_HLDTOTAL_PRICE where T_date=TYDW.fun_date_start_last_end (:YEAR, :num, :style, :fcode)) a,
(select * from TYDW.v_balance_price where T_date=TYDW.fun_date_start_last_end (:YEAR, :num, :style, :fcode)) b,
(select * from TYDW.v_hlddetail_price where T_date=TYDW.fun_date_start_last_end (:YEAR, :num, :style, :fcode)) c,
(select * from TYDW.v_symbol_price where T_date=TYDW.fun_date_start_last_end (:YEAR, :num, :style, :fcode)) d
WHERE a.t_date = b.t_date
AND a.t_date = c.t_date
AND a.t_date = d.t_date
AND a.f_code = b.f_code
AND a.f_code = c.f_code
AND a.f_code = d.f_code
AND a.f_code = :fcode
- where 函数问题引起执行计划改变(复杂视图)
- 使用常规字符串函数及动态视图解决where in list问题(读书笔记之三)
- 利用DDL改变执行计划
- 如何改变oracle的执行计划(HINT)
- php计划任务(定时执行函数)
- 请教sql执行效率问题(inner join 和 where)
- 处理因执行计划变更导致的性能问题(SQL执行次数、执行计划变化)
- 数据量增加导致mysql执行计划改变
- 修改统计信息改变执行计划(ORACLE)
- 几种改变执行计划的方法
- 数据库迁移导致sql 执行计划改变
- ORACLE获得执行计划的相关视图
- Oracle执行计划、物化视图初探
- PostgreSQL join where 条件不同 explain 执行计划的差别
- 物化视图引起的性能问题
- imagecreatefrompng函数引起的问题
- 权限问题引起的批处理文件执行不了
- 记一次SQL语句编写不规范引起的小问题(where条件varchar自动转number)
- 石子游戏(一)
- simple-spring-memcached简介
- JAVA:Eclipse 下找不到或无法加载主类的问题
- Xcode禁用代码分析的警告和内存泄漏
- 爬虫 第一篇
- where 函数问题引起执行计划改变(复杂视图)
- Makefile中指示符“include”、“-include”和“sinclude”的区别
- 如何判断栈的增长方向?
- jetty eclipse环境搭建
- 鸽巢排序(Pigeonhole sort)
- 如何实现Extjs的grid单元格只让选择(即可以复制单元格内容)但是不让修改?
- 在线excel转换为pdf
- 黑马程序员_内部类
- CorePlot学习七---坐标轴的详细分析