DBMS Notes

 Swapping of Non-Conflict Pairs

Before to lean, swapping of Non-Conflict pairs you must know about conflict pairs in DBMS.

Keep in Mind: You must remember only the Non-conflict pairs are swappable. There is no possibility to swap the conflict pairs.

Why We Use Swapping?

Sometimes given schedule is parallel; we try to make it serial through swapping of non-conflict pairs. If given schedule becomes serial then this schedule is known conflict serializable schedule otherwise it will not be conflict serializable schedule.

Method To Swap Non-Conflict Pairs

  • Find the Adjacent Non-conflict pairs.
  • Swap the non-conflict pairs.

Condition for swapping

  • Just swap position of non-conflict pairs in the same transaction, don’t swap operation of that transaction.

How To Swapping?

Let explain with example, consider the following schedule

Step 01:  First find the “adjacent Non-conflict pair” from the given schedule,  if it exist then swap it as given below in the diagram

Step 02: Repeat the step 1 until there is no adjacent non-conflict pair exist.

As we can see the given schedule “A” (which was not serial ) is converted into serial schedule. so, it is a serial schedule.  After swapping, if the given schedule (Say “A”) becomes serial and equal to some other schedule(Say “B”) then both schedules  (“A” and “B”) will be conflict equivalent schedules.

Example 02:

In the following example, there is no adjacent non-conflict pair exist, so the following schedule cannot convert into serial so the following schedule is not serial.


Help Other’s By Sharing…

Contact Us

Burewala, Vehari, Punjab, Pakistan


Website: CStaleem.com

Pin It on Pinterest