ROWID更新提升UPDATE性能,不能用merge时
2015-03-19 16:53
330 查看
declare
maxrows number default 100000;
row_id_table dbms_sql.urowid_table;
--currcount_table dbms_sql.number_Table;
object_name_table dbms_sql.varchar2_Table;
cursor cur_b is
SELECT /*+ index(a) use_hash(a,b) index(b) */
a.object_name, b.ROWID ROW_ID
FROM A, B
WHERE A.object_id = B.object_id
ORDER BY B.ROWID;
v_counter number;
begin
v_counter := 0;
open cur_b;
loop
EXIT WHEN cur_b%NOTFOUND;
FETCH cur_b bulk collect
into object_name_table, row_id_table limit maxrows;
forall i in 1 .. row_id_table.count
update b
set object_name = object_name_table(i)
where rowid = row_id_table(i);
commit;
end loop;
end;
/
maxrows number default 100000;
row_id_table dbms_sql.urowid_table;
--currcount_table dbms_sql.number_Table;
object_name_table dbms_sql.varchar2_Table;
cursor cur_b is
SELECT /*+ index(a) use_hash(a,b) index(b) */
a.object_name, b.ROWID ROW_ID
FROM A, B
WHERE A.object_id = B.object_id
ORDER BY B.ROWID;
v_counter number;
begin
v_counter := 0;
open cur_b;
loop
EXIT WHEN cur_b%NOTFOUND;
FETCH cur_b bulk collect
into object_name_table, row_id_table limit maxrows;
forall i in 1 .. row_id_table.count
update b
set object_name = object_name_table(i)
where rowid = row_id_table(i);
commit;
end loop;
end;
/
相关文章推荐
- sql server merge into 与update 批量更新1 百万测试数据的性能比较
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- ORACLE 大数据批量更新 MERGE INTO 代替 UPDATE/INSERT INTO 提升性能
- Oracle 利用 rowid 提升 update 性能
- Oracle 利用 rowid 提升 update 性能
- SQL之merge into 批量更新数据 sql数据同步 基于源表对目标表做Insert,Update,Delete操作
- PL/SQL编辑数据"这些查询结果不可更新,请包括ROWID或使用SELECT...FOR UPDATE获得可更新结果"处理
- IFeatureCursor.UpdateFeature不能更新MDB的问题
- oracle 不能更新 PL/SQL 点击“edit data”报“ these query results are not updateable”
- dynamic-insert,dynamic-update能够性能上的少许提升
- Win8.1 Update不能正常更新提示错误代码80070020的修复方法
- Hive相关 & 提升Hive性能方法收集(持续更新ing)
- linux+php+svn update+中文问题不能更新svn
- dynamic-insert,dynamic-update能够性能上的少许提升
- update access 不能更新