Speeding up rollback

  • Hi,

    I was having trouble fully grasping an entry in Books Online:

    "For each transaction, all log records associated with the transaction are singly-linked in a chain using backward pointers that speed the rollback of the transaction."

    I don't know if I sound rather stupid but how does having backward pointers speed up rollback? In fact, even if these were forward pointers, the rollback would be quick if not quicker. The reason for this is that as the SQL Server reverses the first operation on data item A and goes forward, if it encounters data item A again, it need not reverse that operation. But I am quite sure I am wrong somewhere as the engineers at Microsoft must have thought about that already. Please correct my understanding. Would greatly appreciate it.

    Karim

  • Documentation says that 'log records' are linked using backward pointers but it says nothing about actual rollback process.

     

    To be able to find all log records in a file you need some pointer mechanism. Both, forward pointers or backward pointers would work but in this case the second choice is better because process of writing log is incremental activity.

     

    To make a forward pointer you would have to edit old record and that can’t be done incrementaly.

     

  • A rollback would be done in reverse order to how they are in the transaction, so backward pointers make sense. You go backwards through the log records to roll back...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply