100分求优化SQL
select aa.workitem_id,aa.formset_inst_id,bb.receive_time,aa.complete_time from
(select a.workitem_id,a.formset_inst_id,a.complete_time from mv_workitem a where workitem_id in (
select max(t.workitem_id) from mv_workitem t where t.formset_id=347 and t.receiver_dept='总裁办公室(股份)' and t.app_type_name='部门阅办文件' group by t.formset_inst_id) order by workitem_id)aa,
(select a.workitem_id,a.formset_inst_id,a.receive_time from mv_workitem a where a.receive_time in(
select min(t.receive_time)
from mv_workitem t where t.formset_id=347 and t.receiver_dept='总裁办公室(股份)' and t.app_type_name='部门阅办文件' group by t.formset_inst_id))bb where aa.workitem_id=bb.workitem_id
查出结果105条,目前在plsql上看到的时间 1.15-1.25秒之间
忘设置分数 我又重发了一个100分的 2个贴一起给分一共140
...全文
相关推荐
(高职)《SQL-Server数据库技术》期末考试卷综合测试题带答案10.doc
(高职)《SQL-Server数据库技术》期末考试卷综合测试题带答案10.doc
100万条数据导入SQL数据库仅用4秒
100万条数据导入SQL数据库仅用4秒,100万条数据导入SQL数据库仅用4秒
oracle sql优化100条
oracle sql常用的优化共100条,很实用
优化临时表使用,SQL语句性能提升100倍
【问题现象】 线上mysql数据库爆出一个慢查询,DBA观察发现,查询时服务器IO飙升,IO占用率达到, 执行时间长达7s左右。 SQL语句如下: SELECT DISTINCT g.*, cp.name AS cp_name, c.name AS category_name, t.name AS type_name FROMgm_game g LEFT JOIN gm_cp cp ON cp.id = g.cp_id AND cp.deleted = 0 LEFT JOIN gm_category c ON c.id = g.category_id AND c.delete
SQL Server SQL优化
SQL Server SQL优化


基础和管理
