免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3025 | 回复: 6
打印 上一主题 下一主题

请教高手:如何提高UPDATE语句的速度 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-03-14 17:14 |只看该作者 |倒序浏览
以下语句执行大约需要3-4分钟,有什么方法可以提高其执行速度?
其中sms_no为主键,state为索引

update test
set state = 'O',Oper_time = sysdate
where sms_no in (2015655,2015656,2015657,2015658,2015659,2015660,2015661,2015662,2015663,2015664,2015665,2015666,
2015667,2015668,2015669,2015670,2015672,2015673,2015674,2015675,2015676,2015677,2015678,2015679,2015681,2015682,
2015683,2015684,2015685,2015686,2015687,2015688,2015689,2015690,2015691,2015692,2015693,2015694,
2015695,2015696,2015697,2015698,2015699,2015700,2015701,2015702,2015703,2015704,2015705,2015706)

论坛徽章:
0
2 [报告]
发表于 2003-03-14 17:23 |只看该作者

请教高手:如何提高UPDATE语句的速度

update test
set state = 'O',Oper_time = sysdate
where sms_no >;=2015655 and sms_no <=2015706

论坛徽章:
0
3 [报告]
发表于 2003-03-14 17:27 |只看该作者

请教高手:如何提高UPDATE语句的速度

update test
set state = 'O',Oper_time = sysdate
where (sms_no >;=2015655 and sms_no <=2015670)
or (sms_no >;=2015672 and sms_no <=2015679) or
(sms_no >;=2015681 and sms_no <=2015706);

论坛徽章:
0
4 [报告]
发表于 2003-03-14 17:30 |只看该作者

请教高手:如何提高UPDATE语句的速度

update test
set state = 'O',Oper_time = sysdate
where  sms_no >;=2015655 and sms_no <=2015706
and sms_no not in (2015671,2015680);

论坛徽章:
0
5 [报告]
发表于 2003-03-14 17:57 |只看该作者

请教高手:如何提高UPDATE语句的速度

谢谢各位,现在速度提高了!

论坛徽章:
0
6 [报告]
发表于 2003-03-15 09:29 |只看该作者

请教高手:如何提高UPDATE语句的速度

这两个人说的都可以,那你到底是听谁的?
我没有作测试,但是这两个人的方法到底谁好?

论坛徽章:
0
7 [报告]
发表于 2003-03-15 17:11 |只看该作者

请教高手:如何提高UPDATE语句的速度

原帖由 "clytcn" 发表:
update test
set state = 'O',Oper_time = sysdate
where sms_no >;=2015655 and sms_no <=2015706
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP