Search code examples
sql-serverisolation-levelread-uncommittedread-committed

Read Committed vs Read Uncommited if both transaction do not rollback


I am trying to understand read committed and read uncommitted isolation levels. I know that theoreticay read uncommitted allows dirty reads and read committed doesn't, but I still can't really understand.

this example

Considering Figure above, if none of the transactions were aborted then the final result is the same for both read committed and read uncommitted?


Solution

  • If you work with read committed isolation level, T2 needs to wait on step 4 for T1 to finish and commit its work. furthermore T1 in step 6 cannot find Nome with Maria% thus, deletes 0 rows.

    but on read uncommitted isolation level, both read/write operations can be done simultaneously.

    Result For read committed isolation level,

    Pessoas (Jaoa Silva, 96.....)
    Pessoas (Maria Fon..., 9199...)
    Pessoas (Joao Manuel Silva, 9699...)
    

    whereas for read uncommitted isolation level

    Pessoas (Joao Manuel Silva, 9699...)