Deriving summary information
ID REF_NO REMARKS1 REMARKS2
1 A001 text1 text2
2 A001 text1 text2
3 A002 text1 text2
4 A003 text1 text2
5 A003 text1 text2
I would like to store the max(ID) for each REF_NO instead of deriving it, for performance reasons. I have considered the following options but could not use them for the reasons specified below:
- materialized views: data is highly volatile thus I would require a FAST refresh as I need real-time data at all times, but in this case it's not possible due to the aggregation MAX function
- triggers: unable to use row-level triggers to satisfy the query which requires a table lookup (ORA-04091 mutating trigger exception)