首页 > 解决方案 > 而不是更新触发器性能问题

问题描述

我在 oracle 上为我的应用程序开发了一个触发器,以将视图的所有更新定向到上表。

但是,这会导致性能问题。

这里是触发器

create or replace trigger trg_triggerview
instead of update
on view_based_on_table
begin
   - ------------------------------------
   if (: new.transfer_counter_column_view is not null) then
     update table t
     set transfer_counter_column_table =: new.transfer_counter_column_view 
     where t.id =: old.id;
   end if;
   -
end;
/

old trigger trg_triggerview ENABLE
;

transfer_counter_column_view 基于表的 transfer_counter_column_table 的视图。

表中的 id 与视图中的相同。

这就是为 id 过滤 where 子句的原因。

传输计数器在客户端每分钟更新多达 300 次

有人知道这个的高性能解决方案吗?

标签: oracleperformancetriggerssql-update

解决方案


推荐阅读