开发者

Performance Implications of Using Oracle DBMS_WM.EnableVersioning

开发者 https://www.devze.com 2023-02-15 14:54 出处:网络
The command to enable versioning (part of开发者_C百科 what Oracle calls Workspace Management) in Oracle (DBMS_WM.EnableVersioning) creates non-materialized views, which cannot be indexed.Will this kil

The command to enable versioning (part of开发者_C百科 what Oracle calls Workspace Management) in Oracle (DBMS_WM.EnableVersioning) creates non-materialized views, which cannot be indexed. Will this kill performance, or will the indexes for the _AUX, _LT, and _LCK tables be used when the views are queried?

Are there significant performance issues in addition to indexing when enabling versioning?

I am using Oracle 11g.


As with most things, it depends.

  • Do you have queries today that need to do table scans to fetch all their data? Or is everything going to go through an index?
  • What is the use case? Are you using Workspace Manager to support long-running transactions? Or to maintain history data in a single LIVE workspace?
  • How frequently do rows change? How many versions of a row are you planning to keep?

If you have existing queries that will do table scans, the table is rebuilt every night, and you plan on keeping history data forever, you're likely going to have major performance issues. If all your queries use indexes to access data, rows change infrequently, and you just intend to retain a few versions of history, the indexes on the underlying tables should be sufficient.

We've used Workspace Manager to maintain history on relatively slowly changing tables forever as well as relatively fast changing tables for a month. And we've used it to maintain discrete savepoints across tables in a few applications so that users can permanently save the state of application data at interesting points in time. In general, we've been satisfied with performance though complex queries will occasionally go off into the weeds when the optimizer gets confused.

Since you're on 11g, you may also consider Total Recall. It's an extra-cost option on top of the enterprise license but it provides a much more efficient architecture for tracking changes to data over time assuming that you intend to store all changes for a fixed period of time. On the other hand, you're more limited in the DDL you can issue without causing history to be discarded which tends to be a rather serious constrain in the applications I've worked on.

0

精彩评论

暂无评论...
验证码 换一张
取 消