# Conflict Serializability (Precedence Graph) & B+ Tree Order Math
Exam: GATE Computer Science & Information Technology (GATE CS)
Subject: Databases (DBMS)
Canonical URL: https://gateandnet.com/exams/gate-cs/databases/serializability-and-bplus-trees

> Testing conflict serializability via cycle detection, counting topological serial equivalents, and B vs B+ tree node equations.

## Conflict Serializability & Precedence Graph

Two operations conflict if they belong to **different transactions**, access the **same data item $X$**, and **at least one is a `WRITE(X)`** (`RW`, `WR`, or `WW`).

1. Build directed graph $G = (T, E)$ with edge $T_i \to T_j$ whenever an operation in $T_i$ precedes and conflicts with one in $T_j$.
2. Schedule $S$ is **Conflict Serializable $\iff G$ has NO directed cycle (is a DAG)**!
3. Every Conflict Serializable schedule is **View Serializable**, **not** vice-versa (blind writes can create view-serializable schedules with cycles).


## Solved Practice Questions & PYQs

### [GATE CS DBMS NAT | NAT]
In a $B^+$ tree index, disk block size is $1024\text{ bytes}$, search key size is $12\text{ bytes}$, block pointer is $8\text{ bytes}$, and data record pointer is $10\text{ bytes}$. What is the **maximum order $p$** (maximum block pointers) of an **internal (non-leaf) node**?
**Correct Answer:** 51
**Solution:** Internal nodes of a $B^+$ tree do NOT store record pointers:
$$p(8) + (p - 1)(12) \le 1024 \implies 20p - 12 \le 1024 \implies 20p \le 1036 \implies p = \lfloor 51.8 \rfloor = \mathbf{51}$$
