a rollback is supposed to do the exact opposite of what it did in the transaction. so a rollback of an insert, will mean deleting all the newly inserted rows, or rollback of an update will mean reupdating the rows with the old values etc.
during a transaction, pages of the object are in both the memory and disk. so a rollback can affect both.
so a rollback on a delete tran will reinsert the old data back in the pages (in memory and disk). likewise with an update where it will put back the old values.
in both cases, i think it will deal (mostly) with pages already existing on the table (without any newly allocated pages).
but let us suppose there is an insert of a million rows. so new pages will be allocated? so during transaction, bunch of it will be in memory and disk. so on a rollback, will newly allocated pages be simply discarded (on memory and disk) without being specifically deleted? so will a rollback on an insert take lesser time than a rollback on an update or delete?
the reason i am asking this is many a time i have seen rollbacks take a long time and other rollbacks which are done instananeously. so trying to understand the dynamics.
appreciate the insights.