Skip to Main Content
  • Questions
  • Performance of Workspace Manager savepoint vs. transaction rollback

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Allan.

Asked: March 23, 2006 - 8:02 pm UTC

Last updated: March 24, 2006 - 10:16 am UTC

Version: 10.2

Viewed 1000+ times

You Asked

Given two approaches to "what if" scenarios:

1) Do work in a transaction. Involves a fairly complex process, many updates. Evaluate results, and if undesireable, rollback and try with new parameters, else commit. The try/rollback may be repeated several times until a desireable result is achieved.

2) Create a workspace, with all the necessary tables, create a savepoint, and perform the work. If results are undesireable, rollback to the savepoint and try again with other parameters, else merge results back into the "live" tables.

Currently I am doing option 1. The process involved is scheduling a series of events over time. There are sequencing rules and other constraints, and the parameters that can be adjusted are the relative priorities of the rules. Desireability of the result is determined by the number of rules violated, weighted by the priority of the rule. I have several differnt rule sets, which I try in sequence until a good result is obtained.

Is there enough information here to say that it is likely that a workspace rollback to a savepoint would be faster than a transaction rollback, for a "large" rollback (tens or hundreds of thousands of rows)? I really just discovered workspace manager, the ability to have the "what if" results contained in a workspace is appealing. But if putting this process into a workspace is likely (or certainly) going to perform worse, I don't want to go that route, at least not in an attempt to improve performance.


and Tom said...

If option 1 is working for you - it would be more efficient than option 2.

Option 2 would be good if you need "long term" what iffing - that survives a database logon logout. If you can do this in a single transaction - do it.

Just remember - rolling back takes at least as much if not more resources then the original transaction did. I'd spend most of my time trying to figure out how to get out of the position of having to rollback.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks

Allan, March 24, 2006 - 11:56 am UTC

Thank you for the answer. The longer-term "what iffing" is something that I will probaly explore in its own right, but good to know that the workspace/savepoint approach, by itself, is not performance improver over a transaction rollback.