GateAI
Transactions and Concurrency Control

GATE CSE 2021 Set 1 · Q32

MCQ2 marksMedium

Time

Let ri(z)r_i(z) and wi(z)w_i(z) denote read and write operations respectively on a data item zz by a transaction TiT_i. Consider the following two schedules. S1:r1(x) r1(y) r2(x) r2(y) w2(y) w1(x)S_1 : r_1(x)\ r_1(y)\ r_2(x)\ r_2(y)\ w_2(y)\ w_1(x) S2:r1(x) r2(x) r2(y) w2(y) r1(y) w1(x)S_2 : r_1(x)\ r_2(x)\ r_2(y)\ w_2(y)\ r_1(y)\ w_1(x) Which one of the following options is correct?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) S1 is not conflict serializable, and S2 is conflict serializable.

Transactions and Concurrency Control

To check for conflict serializability, we construct the precedence (serialization) graph for each schedule:

  1. Schedule S1S_1:

    • Conflicting operations on item yy: r1(y)r_1(y) is executed before w2(y)w_2(y), which creates a directed edge T1→T2T_1 \rightarrow T_2.

    • Conflicting operations on item xx: r2(x)r_2(x) is executed before w1(x)w_1(x), which creates a directed edge T2→T1T_2 \rightarrow T_1.

    • The precedence graph contains a cycle: T1↔T2T_1 \leftrightarrow T_2. Therefore, S1S_1 is not conflict serializable.

  2. Schedule S2S_2:

    • Conflicting operations on item yy: w2(y)w_2(y) is executed before r1(y)r_1(y), which creates a directed edge T2→T1T_2 \rightarrow T_1.

    • Conflicting operations on item xx: r2(x)r_2(x) is executed before w1(x)w_1(x), which creates a directed edge T2→T1T_2 \rightarrow T_1.

    • The precedence graph contains no cycle (only the edge T2→T1T_2 \rightarrow T_1). Therefore, S2S_2 is conflict serializable.

Hence, S1S_1 is not conflict serializable, and S2S_2 is conflict serializable, which corresponds to option B.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Transactions and Concurrency Control previous year question is Q32 of the GATE CSE 2021 Set 1 paper. Find more GATE CSE PYQs on Transactions and Concurrency Control in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Transactions and Concurrency Control PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Transactions and Concurrency Control in GATE CSE

Transactions and Concurrency Control has 25 GATE CSE PYQs across 20 papers from 2012 to 2026. 12 of them are 2-mark MCQs like this one, and GATE CSE 2021 Set 1 has 2.

How GATE tests Transactions and Concurrency Control

More from GATE CSE 2021 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 1 · Q32 · MCQ

Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti. Consider the following two schedules. S1 : r1(x) r1(y) r2(x) r2(y) w2(y) w1(x) S2 : r1(x) r2(x) r2(y) w2(y) r1(y) w1(x) Which one of the following options is correct?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.