【发布时间】:2020-06-10 08:30:39
【问题描述】:
我需要你的帮助来更新一个大表(大约 50 亿行 - 基本 oracle 11g)。 我使用 SQL plus 从 SHELL 脚本生成并执行我的更新,但我的查询的执行需要很多时间,有没有办法加快我的更新:
Update My_table
Set CODE = ‘F’ where date=’2020/06/05’ and ID=’87444’ and GROUP=’GGG’ and NUM_FAC=’15444’
Update My_table
Set CODE = ‘D’ where date=’2020/06/01’ and ID=’85544’ and GROUP=’GGG’ and NUM_FAC=’55555’
Update My_table
Set CODE = ‘I’ where date=’2020/06/03’ and ID=’85544’ and GROUP=’GGG’ and NUM_FAC=’55555’
….. Plusieurs lignes
Commit ; ```
Exit SUCCESS
Thank you in advance for your help.
【问题讨论】:
-
在你得到答案之前,这是一本好书:asktom.oracle.com/pls/asktom/…
-
您将总共更新 50 亿行中的多少?你有什么索引?
-
您使用的是 Postgresql 还是 Oracle?
标签: sql oracle11g oracle-sqldeveloper