简单Update语句,但是效率忽快忽慢~~
这是一句简单的update一句,有时候跑只要10秒,有时候跑要10分钟甚至20分钟,是怎么回事?是服务器、数据库性能的问题?有其他东西抢资源?
update tmp_report t1
set report_type='项目'
where exists (select 1 from v_detail t2
where t1.report_num=t2.report_num
and t1.report_detail_num=t2.report_detail_num
and t2.num_answer in (1,2,3)
and t2.question_type=1299);
tmp_report 中有索引在report_num和report_detail_num;10万行记录;
v_detail 中的主键是report_num和report_detail_num以及几个别的字段;千万行记录。
这么写规范吗?怎么写才能更规范更快?
Oracle新手求教。
update tmp_report t1
set report_type='项目'
where exists (select 1 from v_detail t2
where t1.report_num=t2.report_num
and t1.report_detail_num=t2.report_detail_num
and t2.num_answer in (1,2,3)
and t2.question_type=1299);
tmp_report 中有索引在report_num和report_detail_num;10万行记录;
v_detail 中的主键是report_num和report_detail_num以及几个别的字段;千万行记录。
这么写规范吗?怎么写才能更规范更快?
Oracle新手求教。
...全文
相关推荐
update 语句优化update 语句优化update 语句优化
update 语句优化
生成UPDATE语句
根据表结构生成打印出根据主键update的语句
ORACLE多表关联的update语句
在某个业务受理子系统BSS中, --客户资料表 create table customers ( customer_id number(8) not null, -- 客户标示 city_name varchar2(10) not null, -- 所在城市 customer_type char(2) not null, -- 客户类型 ... ) create unique index PK_customers on customers (customer_id) 由于某些原因,客户所在城市这个信息并不什么准确,但是在 客户服务部的CRM子系统中,通过主动服务获取了部分客户20%的所在 城市等准确信息,于是你将该部分信息提取至一张临时表中: create table tmp_cust_city ( customer_id number(8) not null, citye_name varchar2(10) not null, customer_type char(2) not null )
insert,update导出sql语句
insert,update导出sql语句,很实用的小工具
mysql update语句的用法详解
本文详细介绍了,mysql中update语句的用法,系统全面的学习下update更新语句的用法,有需要的朋友可以参考下


基础和管理
