DBMS unit4
DBMS unit4
Transactions refer to a set of operations that are used for performing a set of
logical work. Usually, a transaction means the data present in the DB has
changed. Protecting the user data from system failures is one of the primary
uses of DBMS.
We can define a transaction as a group of tasks in DBMS. Here a single task
refers to a minimum processing unit, and we cannot divide it further. Now let us
take the example of a certain simple transaction. Suppose any worker transfers
Rs 1000 from X’s account to Y’s account. This given small and simple
transaction involves various low-level tasks.
o The transaction is a set of logically related operation. It contains a group
of tasks.
o A transaction is an action or series of actions. It is performed by a single
user to perform operations for accessing the contents of the database.
X’s Account
Open_Account(X)
Old_Bank_Balance = X.balance
New_Bank_Balance = Old_Bank_Balance – 1000
A.balance = New_Bank_Balance
Close_Bank_Account(X)
Y’s Account
Open_Account(Y)
Old_Bank_Balance = Y.balance
New_Bank_Balance = Old_Bank_Balance + 1000
B.balance = New_Bank_Balance
Close_Bank_Account(Y)
X's Account
1. Open_Account(X)
2. Old_Balance = X.balance
3. New_Balance = Old_Balance - 800
4. X.balance = New_Balance
5. Close_Account(X)
Y's Account
1. Open_Account(Y)
2. Old_Balance = Y.balance
3. New_Balance = Old_Balance + 800
4. Y.balance = New_Balance
5. Close_Account(Y)
Property of Transaction
1. Atomicity
2. Consistency
3. Isolation
4. Durability
Atomicity
o It states that all operations of the transaction take place at once if not, the
transaction is aborted.
o There is no midway, i.e., the transaction cannot occur partially. Each
transaction is treated as one unit and either run to completion or is not
executed at all.
Abort: If a transaction aborts then all the changes made are not visible.
Read(A) Read(B)
A:= A-100 Y:= Y+100
Write(A) Write(B)
Consistency
o The integrity constraints are maintained so that the database is consistent
before and after the transaction.
o The execution of a transaction will leave a database in either its prior
stable state or a new stable state.
o The consistent property of database states that every transaction sees a
consistent database instance.
o The transaction is used to transform the database from one consistent
state to another consistent state.
For example: The total amount must be maintained before or after the
transaction.
Isolation
o It shows that the data which is used at the time of execution of a
transaction cannot be used by the second transaction until the first one is
completed.
o In isolation, if the transaction T1 is being executed and using the data
item X, then that data item can't be accessed by any other transaction T2
until the transaction T1 ends.
o The concurrency control subsystem of the DBMS enforced the isolation
property.
Durability
o The durability property is used to indicate the performance of the
database's consistent state. It states that the transaction made the
permanent changes.
o They cannot be lost by the erroneous operation of a faulty transaction or
by the system failure. When a transaction is completed, then the database
reaches a state known as the consistent state. That consistent state cannot
be lost, even in the event of a system's failure.
o The recovery subsystem of the DBMS has the responsibility of Durability
property.
States of Transaction
Active state
o The active state is the first state of every transaction. In this state, the
transaction is being executed.
o This is the state in which a transaction is being executed. Thus, it is like
the initial state of any given transaction.
o For example: Insertion or deletion or updating a record is done here. But
all the records are still not saved to the database.
Partially committed
o In the partially committed state, a transaction executes its final operation,
but the data is still not saved to the database.
o In the total mark calculation example, a final display of the total marks
step is executed in this state.
o A transaction is in its partially committed state whenever it executes the
final operation.
o
Committed
Failed state
o In the example of total mark calculation, if the database is not able to fire
a query to fetch the marks, then the transaction will fail to execute.
o In case any check made by a database recovery system fails, then that
transaction is in a failed state. Remember that a failed transaction can not
proceed further.
Aborted
o If any of the checks fail and the transaction has reached a failed state then
the database recovery system will make sure that the database is in its
previous consistent state. If not then it will abort or roll back the
transaction to bring the database into a consistent state.
o If the transaction fails in the middle of the transaction then before
executing the transaction, all the executed transactions are rolled back to
its consistent state.
o After aborting the transaction, the database recovery module will select
one of the two operations:
1. Re-start the transaction
2. Kill the transaction
Operations of Transaction:
Read(X): Read operation is used to read the value of X from the database and
stores it in a buffer in main memory.
Write(X): Write operation is used to write the value back to the database from
the buffer.
1. 1. R(X);
2. 2. X = X - 500;
3. 3. W(X);
o The first operation reads X's value from database and stores it in a buffer.
o The second operation will decrease the value of X by 500. So buffer will
contain 3500.
o The third operation will write the buffer's value to the database. So X's
final value will be 3500.
For example: If in the above transaction, the debit transaction fails after
executing operation 2 then X's value will remain 4000 in the database which is
not acceptable by the bank.
Scheduling in DBMS
Overview
Scheduling is the technique of preserving the order of the operations from one
transaction to another while executing such concurrent transactions. A series of
operations from one transaction to another transaction is known as a schedule.
Types of Schedules
1. Serial Schedule
2. Non-serial Schedule Further, they are divided into their subcategories, as
shown below.
Serial Schedule
As the name says, all the transactions are executed serially one after the other.
In serial Schedule, a transaction does not start execution until the currently
running transaction finishes execution. This type of execution of the transaction
is also known as non-interleaved execution. Serial Schedule are always
recoverable, cascades, strict and consistent. A serial schedule always gives the
correct result.
Transactions present in this schedule are executed serially, after the instruction
of Ti completes, the instructions of Tj will be executed, where j=i+1.
Serial schedule guarantee consistency −
For 2 transactions, total number of serial schedules possible = 2.
For 3 transactions, total number of serial schedules possible = 6.
2 Transaction 3 Transaction
T1->T2 T1->T2->T3
T2->T1 T1->T3->T2
T2->T1->T3
T2->T3->T1
T3->T1->T2
T3->T2->T1
In this Schedule, there are two transactions, T1 and T2, executing concurrently.
The operations of T1 and T2 are interleaved. So, this Schedule is an example of
a Non-Serial Schedule.
Total number of non-serial schedules = Total number of schedules – Total
number of serial schedules
READ1(A)
WRITE1(A)
READ2(B)
WRITE2(B)
READ1(B)
WRITE1(B)
READ1(B)
That means,
Readi(x) readj(x) - non conflict read-read operation
Readi(x) writej(x) - conflict read-write operation.
Writei(x) readj(x) - conflict write-read operation.
Writei(x) writej(x) - conflict write-write operation.
Conflicting Operations-
Example-
Step-01:
Step-02:
Start creating a precedence graph by drawing one node for each transaction.
Step-03:
Draw an edge for each conflict pair such that if X i (V) and Yj (V) forms a
conflict pair then draw an edge from Ti to Tj.
This ensures that Ti gets executed before Tj.
Step-04:
NOTE-
Solution-
Step-01:
List all the conflicting operations and determine the dependency between the
transactions-
R2(A) , W1(A) (T2 → T1)
R1(B) , W2(B) (T1 → T2)
R3(B) , W2(B) (T3 → T2)
Step-02:
Solution-
Step-01:
List all the conflicting operations and determine the dependency between the
transactions-
R2(X) , W3(X) (T2 → T3)
R2(X) , W1(X) (T2 → T1)
W3(X) , W1(X) (T3 → T1)
W3(X) , R4(X) (T3 → T4)
W1(X) , R4(X) (T1 → T4)
W2(Y) , R4(Y) (T2 → T4)
Step-02:
Alternatively,
There exists no dirty read operation.
This is because all the transactions which update the values commits
immediately.
Therefore, the given schedule S is recoverable.
Also, S is a Cascadeless Schedule.
Problem-03:
Check whether the given schedule S is conflict serializable or not. If yes, then
determine all the possible serialized schedules-
Solution-
Step-01:
List all the conflicting operations and determine the dependency between the
transactions-
R4(A) , W2(A) (T4 → T2)
R3(A) , W2(A) (T3 → T2)
W1(B) , R3(B) (T1 → T3)
W1(B) , W2(B) (T1 → T2)
R3(B) , W2(B) (T3 → T2)
Step-02:
Problem-04:
Determine all the possible serialized schedules for the given schedule-
Solution-
Step-02:
View Serializability
A Non-Serializability in DBMS
Recoverable Schedule
A schedule is recoverable if each transaction commits only after all the
transactions from which it has read have committed. In other words, if some
transaction Ty reads a value that has been updated/written by some other
transaction Tx, then the commit of Ty must occur after the commit of Tx.
Consider the following example −
T1 T2
R(X)
W(X)
W(X)
R(X)
READ1(B)
Commit
commit
Here, transaction T2 is reading the value written by transaction T1 and the
commit of T2 occurs after the commit of T1. Hence, it is a recoverable
schedule.
Non-Recoverable Schedule
If a transaction reads the value of an operation from an uncommitted
transaction and commits before the transaction from where it has read the
value, then such a schedule is called Non-Recoverable schedule. A non-
recoverable schedule means when there is a system failure, we may not be able
to recover to a consistent database state. If the commit operation of Ti doesn't
occur before the commit operation of Tj, it is non-recoverable.
A schedule that is not recoverable is non-recoverable. If the commit operation
of Ti doesn't occur before the commit operation of Tj, it is non-recoverable.
Consider an example for the non-recoverable schedule as given below −
Schedule 1
T1 T2
read(x)
x=x-n
write(x)
read(x)
x=x+n
write(x)
commit
Recoverable schedules are further categorized into 3 types:
1. Cascading Schedule
2. Cascadeless Schedule
3. Strict Schedule
Cascading Schedule
A cascading schedule is classified as a recoverable schedule. A recoverable
schedule is basically a schedule in which the commit operation of a particular
transaction that performs read operation is delayed until the uncommitted
transaction either commits or roll backs.
A cascading rollback is a type of rollback in which if one transaction fails, then
it will cause rollback of other dependent transactions. The main disadvantage of
cascading rollback is that it can cause CPU time wastage.
Given below is an example of a cascading schedule −
T1 T2 T3 T4
Read(A)
Write(A)
Read (A)
Write(A)
Read(A)
Write(A)
Read(A)
Write(A)
Failure
The above transaction is cascading rollback because of T1 failure, T2 is
rollback and rollback of T2 causes T3 to rollback and rollback T3 causes the T4
to rollback.
Cascadeless schedule
When a transaction is not allowed to read data until the last transaction which
has written it is committed or aborted, these types of schedules are called
cascadeless schedules.
Given below is an example of a cascadeless schedule −
T1 T2
R(X)
W(X)
W(X)
Commit
R(X)
Commit
Here, the updated value of X is read by transaction T2 only after the commit of
transaction T1. Hence, the schedule is cascadeless schedule.
Strict Schedule
Strict schedule
Given below is an example of a strict schedule −
T1 T2
R(X)
R(X)
W(X)
T1 T2
Commit
W(X)
R(X)
Commit
Failure Classification
To find that where the problem has occurred, we generalize a failure into the
following categories:
1. Transaction failure
2. System crash
3. Disk failure
1. Transaction failure
2. System Crash
o System failure can occur due to power failure or other hardware or
software failure. Example: Operating system error.
3. Disk Failure
o It occurs where hard-disk drives or storage drives used to fail
frequently. It was a common problem in the early days of
technology evolution.
o Disk failure occurs due to the formation of bad sectors, disk head
crash, and unreachability to the disk or any other failure, which
destroy all or part of disk storage.
DBMS Concurrency Control
The problem occurs when two different database transactions perform the
read/write operations on the same database items in an interleaved manner (i.e.,
concurrent execution) that makes the values of the items incorrect hence making
the database inconsistent.
Consider the below diagram where two transactions T X and TY, are
performed on the same account A where the balance of account A is $300.
o At time t1, transaction TX reads the value of account A, i.e., $300 (only
read).
o At time t2, transaction TX deducts $50 from account A that becomes $250
(only deducted and not updated/write).
o Alternately, at time t3, transaction TY reads the value of account A that
will be $300 only because TX didn't update the value yet.
o At time t4, transaction TY adds $100 to account A that becomes $400
(only added but not updated/write).
o At time t6, transaction TX writes the value of account A that will be
updated as $250 only, as TY didn't update the value yet.
o Similarly, at time t7, transaction TY writes the values of account A, so it
will write as done at time t4 that will be $400. It means the value written
by TX is lost, i.e., $250 is lost.
The dirty read problem occurs when one transaction updates an item of the
database, and somehow the transaction fails, and before the data gets rollback,
the updated database item is accessed by another transaction. There comes the
Read-Write Conflict between both transactions.
For example:
For example:
Consider two transactions, TX and TY, performing the read/write
operations on account A, having an available balance = $300. The diagram
is shown below:
o At time t1, transaction TX reads the value from account A, i.e., $300.
o At time t2, transaction TY reads the value from account A, i.e., $300.
o At time t3, transaction TY updates the value of account A by adding $100
to the available balance, and then it becomes $400.
o At time t4, transaction TY writes the updated value, i.e., $400.
o After that, at time t5, transaction TX reads the available value of account
A, and that will be read as $400.
o It means that within the same transaction TX, it reads two different values
of account A, i.e., $ 300 initially, and after updation made by transaction
TY, it reads $400. It is an unrepeatable read and is therefore known as the
Unrepeatable read problem.
Thus, in order to maintain consistency in the database and avoid such problems
that take place in concurrent execution, management is needed, and that is
where the concept of Concurrency Control comes into role.
Concurrency Control
Concurrency Control is the working concept that is required for controlling and
managing the concurrent execution of database operations and thus avoiding the
inconsistencies in the database. Thus, for maintaining the concurrency of the
database, we have the concurrency control protocols.
Concurrency Control Protocols
1. Shared Lock(S)
2. Exclusive Lock(X)
1. Shared Lock(S): Shared lock is placed when we are reading the data,
multiple shared locks can be placed on the data but when a shared lock is placed
no exclusive lock can be placed.
You and your brother have a joint bank account, from which you both can
withdraw money. Now let’s say you both go to different branches of the same
bank at the same time and try to withdraw 5000 INR, your joint account has
only 6000 balance.
Now if we don’t have concurrency control in place you both can get 5000 INR
at the same time but once both the transactions finish the account balance would
be -4000 which is not possible and leaves the database in inconsistent state.
We need something that controls the transactions in such a way that allows the
transaction to run concurrently but maintaining the consistency of data to avoid
such issues.
2. Exclusive Lock(X): Exclusive lock is placed when we want to read and write
the data. This lock allows both the read and write operation, Once this lock is
placed on the data no other lock (shared or Exclusive) can be placed on the data
until Exclusive lock is released.
For example, when a transaction wants to update the Steve’s account balance,
let it do by placing X lock on it but if a second transaction wants to read the
data(S lock) don’t allow it, if another transaction wants to write the data(X lock)
don’t allow that either.
__________________________
| | S | X |
|-------------------------
| S | True | False |
|-------------------------
| X | False | False |
--------------------------
For example, consider a case where initially A=100 when a transaction needs to
deduct 50 from A. We can allow this transaction by placing X lock on it.
Therefore, when the any other transaction wants to read or write, exclusive lock
prevent it. Lock Compatibility Matrix :
If the transaction T1 is holding a shared lock in data item A, then the control
manager can grant the shared lock to transaction T2 as compatibility is
TRUE, but it cannot grant the exclusive lock as compatibility is FALSE.
In simple words if transaction T1 is reading a data item A, then same data
item A can be read by another transaction T2 but cannot be written by
another transaction.
Similarly if an exclusive lock (i.e. lock for read and write operations) is hold
on the data item in some transaction then no other transaction can acquire
Shared or Exclusive lock as the compatibility function denoted FALSE.
We have discussed briefly the first type of Concurrency Control Protocol, i.e.,
Lock-based Protocol.
Now, recalling where we last left off, there are two types of Locks
available Shared S(a) and Exclusive X(a). Implementing this lock system
without any restrictions gives us the Simple Lock-based protocol (or Binary
Locking), but it has its own disadvantages, they do not guarantee
Serializability. Schedules may follow the preceding rules but a non-
serializable schedule may result.
To guarantee serializability, we must follow some additional
protocol concerning the positioning of locking and unlocking operations in
every transaction. This is where the concept of Two-Phase Locking(2-PL)
comes into the picture, 2-PL ensures serializability. Now, let’s dig deep!
Two-Phase Locking –
T1 T2
1 lock-S(A)
2 lock-S(A)
3 lock-X(B)
4 ……. ……
5 Unlock(A)
6 Lock-X(C)
7 Unlock(B)
8 Unlock(A)
9 Unlock(C)
10……. ……
This is just a skeleton transaction that shows how unlocking and locking work
with 2-PL. Note for:
Transaction T1:
The growing Phase is from steps 1-3.
The shrinking Phase is from steps 5-7.
Lock Point at 3
Transaction T2:
The growing Phase is from steps 2-6.
The shrinking Phase is from steps 8-9.
Lock Point at 6
Hey, wait!
What is LOCK POINT? The Point at which the growing phase ends, i.e.,
when a transaction takes the final lock it needs to carry on its work. Now look
at the schedule, you’ll surely understand.
I have said that 2-PL ensures serializability, but there are still some drawbacks
of 2-PL. Let’s glance at the drawbacks:
Cascading Rollback is possible under 2-PL.
Deadlocks and Starvation are possible.
Cascading Rollbacks in 2-PL –
Let’s see the following Schedule:
Take a moment to analyze the schedule. Yes, you’re correct, because of Dirty
Read in T2 and T3 in lines 8 and 12 respectively, when T1 failed we have to
roll back others also. Hence, Cascading Rollbacks are possible in 2-PL. I
have taken skeleton schedules as examples because it’s easy to understand
when it’s kept simple. When explained with real-time transaction problems
with many variables, it becomes very complex.
Deadlock in 2-PL –
Consider this simple example, it will be easy to understand. Say we have two
transactions T1 and T2.
Schedule: Lock-X1(A) Lock-X2(B) Lock-X1(B) Lock-X2(A)
Drawing the precedence graph, you may detect the loop. So Deadlock is also
possible in 2-PL.
Two-phase locking may also limit the amount of concurrency that occurs in a
schedule because a Transaction may not be able to release an item after it has
used it. This may be because of the protocols and other restrictions we may put
on the schedule to ensure serializability, deadlock freedom, and other factors.
This is the price we have to pay to ensure serializability and other factors,
hence it can be considered as a bargain between concurrency and maintaining
the ACID properties.
The above-mentioned type of 2-PL is called Basic 2PL. To sum it up it
ensures Conflict Serializability but does not prevent Cascading Rollback and
Deadlock. Further, we will study three other types of 2PL, Strict 2PL,
Conservative 2PL, and Rigorous 2PL.
Strict:
A transaction needs to comply with 2PL, and release its write (exclusive) locks
only after it has ended, i.e.being either committed or aborted.
The first phase of Strict-2PL is the same as 2PL.
After acquiring all the locks in the first phase, the transaction continues to
execute normally.
Strict-2PL holds all the locks until the commit point and releases all
the locks at a time.
Strict-2PL does not have cascading abort as 2PL does.
On the other hand, read (shared) locks are released regularly during phase 2.
Example:
Rigorous :
It requires that in addition to the lock being 2-Phase all Exclusive(X) and
Shared(S) Locks held by the transaction be released until after the
Transaction Commits.
It guarantees that starvation cannot occur.
Rigorous two-phase locking is even stricter: here all locks are held till
This is to ensure that a transaction that already holds some locks will not
In this protocol, a transaction doesn’t make any changes to the database directly,
instead it performs all the changes on the local copies of the data items that are
maintained in the transaction itself. At the end of the transaction, a validation is
performed on the transaction. If it doesn’t violate any serializability rule, the
transaction commit the changes to the database else it is updated and restarted.
1. Read phase: In this phase, a transaction reads the value of data items from
database and store their values into the temporary local variables.
Transaction then starts executing but it doesn’t update the data items in the
database, instead it performs all the operations on temporary local
variables.
2. Validation phase: In this phase, a validation check is done on the
temporary variables to see if it violates the rules of serializability.
3. Write phase: This is the final phase of validation based protocol. In this
phase, if the validation of the transaction is successful then the values of
temporary local variables is written to the database and the transaction is
committed. If the validation is failed in second phase then the updates are
discarded and transaction is slowed down to be restarted later.
Finish(Tn): It represents the timestamp when the transaction Tn finishes all the
write operations.
If there are two transactions T1 & T2 managed by validation based protocol and
if Finish(T1) < Start(T2) then the validation will be successful as the
serializability is maintained because T1 finished the execution well before the
transaction T2 started the read phase.
Checkpoints in DBMS
Why do we need Checkpoints ?
Whenever transaction logs are created in a real-time environment, it eats up
lots of storage space. Also keeping track of every update and its maintenance
may increase the physical space of the system. Eventually, the transaction log
file may not be handled as the size keeps growing. This can be addressed with
checkpoints. The methodology utilized for removing all previous transaction
logs and storing them in permanent storage is called a Checkpoint.
What is a Checkpoint ?
The checkpoint is used to declare a point before which the DBMS was in the
consistent state, and all transactions were committed. During transaction
execution, such checkpoints are traced. After execution, transaction log files
will be created.
Upon reaching the savepoint/checkpoint, the log file is destroyed by saving its
update to the database. Then a new log is created with upcoming execution
operations of the transaction and it will be updated until the next checkpoint
and the process continues.
to use Checkpoints in How database ?
Steps :
1. Write begin_checkpoint record into log.
2. Collect checkpoint data in the stable storage.
3. Write end_checkpoint record into log.
The behavior when the system crashes and recovers when concurrent
transactions are executed is shown below –
The recovery system reads the logs backward from the end to the last
checkpoint i.e. from T4 to T1.
It will keep track of two lists – Undo and Redo.
Whenever there is a log with instruction <Tn, start>and <Tn, commit> or
only <Tn, commit> then it will put that transaction in Redo List. T2 and T3
contain <Tn, Start> and <Tn, Commit> whereas T1 will have only <Tn,
Commit>. Here, T1, T2, and T3 are in the redo list.
Whenever a log record with no instruction of commit or abort is found, that
transaction is put to Undo List <Here, T4 has <Tn, Start> but no <Tn,
commit> as it is an ongoing transaction. T4 will be put in the undo list.
All the transactions in the redo-list are deleted with their previous logs and
then redone before saving their logs. All the transactions in the undo-list are
undone and their logs are deleted.
Relevance of Checkpoints :
Two schedules are said to be conflict Two schedules are said to be view
equivalent if all the conflicting equivalent if the order of initial read,
operations in both the schedule get final write and update operations is
executed in the same order. If a the same in both the schedules. If a
schedule is a conflict equivalent to schedule is view equivalent to its
its serial schedule then it is called serial schedule then it is called View
1. Conflict Serializable Schedule. Serializable Schedule.
R(X)
R(X)
W(Y)
W(X)
R(Y)
W(Y)
Now, we will list all the conflicting operations. Further, we will determine
whether the schedule is conflict serializable using Precedence Graph.
Two operations are said to be conflicting if the belong to different transaction,
operate on same data and at least one of them is a write operation.
1. R3(X) and W2(X) [ T3 -> T2 ]
2. W1(Y) and R3(Y) [ T1 -> T3 ]
3. W1(Y) and W2(Y) [ T1 -> T2 ]
4. R3(Y) and W2(Y) [ T3 -> T2 ]
Constructing the precedence graph, we see there are no cycles in the graph.
Therefore, the schedule is Conflict Serializable.
The serializable schedule is,
T1 -> T3 -> T2
Example for View Serializability –
Let us consider the following transaction schedule and test it for View
Serializability.
T1 T2 T3
R(A)
W(A)
R(A)
W(A)
W(A)
As we can see that there is a cycle in the precedence graph, it means that
the given schedule is not Conflict Serializable. Now, on checking for blind
write we get that there exists a blind write W2(A) in the given schedule.
Thus, the schedule may or may not be View Serializable.
In order to check for View Serializability, we will draw aDependency Graph of
the schedule. From the given schedule we gather the following points :
1. T1 reads A before T2 updates A thus, T1 must execute before T2.
2. T3 does the final update on A thus, it must execute in the end.
Constructing the dependency graph.
As there exists no cycle in the graph, we can say that the given schedule is
View Serializable.
The serializable schedule is T1 -> T2 -> T3.
Introduction of Shadow Paging
Shadow Paging is recovery technique that is used to recover database. In this
recovery technique, database is considered as made up of fixed size of logical
units of storage which are referred as pages. pages are mapped into physical
blocks of storage, with help of the page table which allow one entry for each
logical page of database. This method uses two page tables named current
page table and shadow page table.
The entries which are present in current page table are used to point to most
recent database pages on disk. Another table i.e., Shadow page table is used
when the transaction starts which is copying current page table. After this,
shadow page table gets saved on disk and current page table is going to be
used for transaction. Entries present in current page table may be changed
during execution but in shadow page table it never get changed. After
transaction, both tables become identical.
This technique is also known as Cut-of-Place updating.