Home » SQL & PL/SQL » SQL & PL/SQL » Commit V/S Rollback
Commit V/S Rollback [message #448968] Fri, 26 March 2010 01:30 Go to next message
harpreetsinghkup
Messages: 52
Registered: May 2006
Location: Mumbai
Member

Hello Experts,

May i know, which operator is more costly (Commit or Rollback) in terms of performance?

Regards
Harpreet Singh
Re: Commit V/S Rollback [message #448969 is a reply to message #448968] Fri, 26 March 2010 01:37 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Rollback as it undoes all what have been done.

You should envisage to read Database Concepts.

Regards
Michel

[Updated on: Fri, 26 March 2010 01:39]

Report message to a moderator

Re: Commit V/S Rollback [message #448974 is a reply to message #448969] Fri, 26 March 2010 01:41 Go to previous messageGo to next message
harpreetsinghkup
Messages: 52
Registered: May 2006
Location: Mumbai
Member

Thanks you very much.

Could you please explain it bit more?. it should be really fine, in case you providing some analytical data also.

Thanks in advance.

Regards
Harpreet Singh
Re: Commit V/S Rollback [message #448976 is a reply to message #448974] Fri, 26 March 2010 01:45 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Could you please read the book I mentioned, it is the basics to understand what I say and without them it is useless to explain you more that what I already said or just quoting the whole book itself.

And I don't know what you mean by "analytical data". You can make a simple test by yourself: update a table and commit, update the same table and rollback and see the times.

Regards
Michel

[Updated on: Fri, 26 March 2010 01:46]

Report message to a moderator

Re: Commit V/S Rollback [message #448977 is a reply to message #448969] Fri, 26 March 2010 01:45 Go to previous messageGo to next message
John Watson
Messages: 6399
Registered: January 2010
Location: Global Village
Senior Member
Anyone want to take it a bit further? On COMMIT, the only activity is to flush the log buffer to disc: a trivial amount of work. To ROLLBACK, all changes applied to data blocks by the transaction must be reversed by extracting data from the undo segment and applying them to the data blocks (this does in itself generate redo) and then the entire transaction (original work plus rollback) must be committed.


Re: Commit V/S Rollback [message #449188 is a reply to message #448968] Sat, 27 March 2010 11:55 Go to previous message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
it is a matter of simply not being stupid when designing a database. Oracle is not stuipd.

If you writing a job, do you expect to the job to finish or not when you run it? I for one expect the job to work 99.99% of the time because if I have a job that is failing all the time then I have a useless job; not to mention that i suck and should not be in the business.

Thus it is reasonable to take the approach that almost all code run will succeed and finish. Therefore what makes more sense?

1) build a database system that is efficient at rollback at the expense of an inefficient commit?

or

2) write a database system that is efficient at commit at the expense of an inefficient rollback?

Kevin
Previous Topic: Can't get this insert right?
Next Topic: Execute privilege
Goto Forum:
  


Current Time: Wed Sep 28 09:15:41 CDT 2016

Total time taken to generate the page: 0.10900 seconds