Indexing and B+ Trees short notes for GATE DA: 2 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Indexing and B Trees short notes
B+ Tree Quick Reference
Core Formulas
Non-Leaf Max Pointers (p): p=⌊Ptr+VB+V⌋
Leaf Max Entries (pleaf): pleaf=⌊V+PdB−Pnext⌋
Structural Constraints
Root: Min 2 pointers (if internal).
Internal Node: Min ⌈p/2⌉ pointers.
Leaf Node: Min ⌈pleaf/2⌉ entries.
Insertion Golden Rules
Leaf overflow → Split →Copy middle key up.
Internal overflow → Split →Push middle key up.
Tree height increases if and only if the root splits.
Index Selection Exam Checklist
Exam Checklist
1
Identify Equality First: Prioritize = conditions for the leftmost position.
2
Range Conditions Second: Place >, <, BETWEEN after equality columns.
3
Check SARGability: No functions, math, or implicit casts on the indexed column.
4
Estimate Selectivity: If matching > 15\text{--}20\%, expect a Full Table Scan.
5
Avoid Bookmark Lookups: Use composite indexes covering all selected columns.
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
Level 1: Warm-up
A B+ tree non-leaf node has a block size of B=104 bytes. The tree pointer size is Ptr=10 bytes, and the search key size is V=5 bytes. What is the maximum number of tree pointers p this node can hold?
Question 2
Level 1: Warm-up
A disk block is 1024 bytes. A B+ tree non-leaf node uses 10-byte tree pointers and 14-byte search keys. What is the maximum number of search keys that can be stored in a single non-leaf node?
Question 3
Level 1: Warm-up
Consider the following Assertion and Reason regarding B+ tree node capacity calculations:
Assertion (A): For a node of size 4 KB, with 10-byte tree pointers and 15-byte search keys, the maximum non-leaf fanout is 164.
Reason (R): The calculation for this fanout uses the inequality 25p≤4000, which yields p=160.
Question 4
Level 1: Warm-up
In a B+ tree where each leaf node can hold at most 5 entries, which of the following entry counts is impossible for a leaf node, assuming the tree contains more than one leaf node?
Question 5
Level 1: Warm-up
In a B+ tree diagram, an internal node contains a single separator key $40$, pointing to a left leaf $L_1$ and a right leaf $L_2$. Assuming standard B+ tree properties where all actual data pointers are at the leaves, which of the following pairs of leaf contents is IMPOSSIBLE?
Question 6
Level 1: Warm-up
Which of the following is IMPOSSIBLE for a non-leaf internal node in a B+ tree of order p=5 (assuming it is not the root)?
Question 7
Level 1: Warm-up
A database system uses a block size of $2048$ bytes for its B+ tree index. The search key size is $16$ bytes, the data record pointer size is $8$ bytes, and the next-leaf pointer size is $8$ bytes. What is the maximum number of entries $p_{leaf}$ that can be stored in a leaf node?
Question 8
Level 1: Warm-up
A B+ tree non-leaf node is built with a block size of $1024$ bytes. The tree pointer size is $8$ bytes and the search key size is $10$ bytes. What is the maximum number of tree pointers this non-leaf node can hold?
Question 9
Level 1: Warm-up
A B+ tree index is built with the following specifications:\\
\\
Block size: $2$ KB\\
Tree pointer size: $6$ bytes\\
Search key size: $10$ bytes\\
\\
What is the maximum number of tree pointers $p$ that can be stored in a non-leaf node?
Question 10
Level 1: Warm-up
In a B+ tree, if a non-leaf internal node has a maximum of p tree pointers, how many search keys does it contain?
Free preview ends here
Login to view the complete short notes
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Indexing and B+ Trees short notes for GATE DA: 2 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
B+ Tree Quick Reference
Core Formulas
Non-Leaf Max Pointers (p): p=⌊Ptr+VB+V⌋
Leaf Max Entries (pleaf): pleaf=⌊V+PdB−Pnext⌋
Structural Constraints
Root: Min 2 pointers (if internal).
Internal Node: Min ⌈p/2⌉ pointers.
Leaf Node: Min ⌈pleaf/2⌉ entries.
Insertion Golden Rules
Leaf overflow → Split →Copy middle key up.
Internal overflow → Split →Push middle key up.
Tree height increases if and only if the root splits.
Index Selection Exam Checklist
Exam Checklist
1
Identify Equality First: Prioritize = conditions for the leftmost position.
2
Range Conditions Second: Place >, <, BETWEEN after equality columns.
3
Check SARGability: No functions, math, or implicit casts on the indexed column.
4
Estimate Selectivity: If matching > 15\text{--}20\%, expect a Full Table Scan.
5
Avoid Bookmark Lookups: Use composite indexes covering all selected columns.
Indexing and B+ Trees: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Database Management and WarehousingMCQ
A B+ tree non-leaf node has a block size of B=104 bytes. The tree pointer size is Ptr=10 bytes, and the search key size is V=5 bytes. What is the maximum number of tree pointers p this node can hold?
A.
7
B.
6
C.
8
D.
9
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a direct formula application for calculating non-leaf node fanout.
Step 1: Recall the inequality for non-leaf nodes: p⋅Ptr+(p−1)⋅V≤B.
Step 2: Substitute the given values: 10p+5(p−1)≤104.
Step 3: Simplify the inequality: 10p+5p−5≤104⟹15p−5≤104.
Step 4: Solve for p: 15p≤109⟹p≤7.26.
Step 5: Since p must be an integer, the maximum value is ⌊7.26⌋=7.
Answer: 7
Question 2 · Database Management and WarehousingMCQ
A disk block is 1024 bytes. A B+ tree non-leaf node uses 10-byte tree pointers and 14-byte search keys. What is the maximum number of search keys that can be stored in a single non-leaf node?
A.
42
B.
43
C.
41
D.
44
Correct Answer:
A
Step-by-Step Solution
Key idea: This is an estimation question about B+ tree fanout calculation, recognizable by the need to solve the block size inequality for the maximum number of keys.
Step 1: Set up the inequality for a non-leaf node. Let p be the max pointers. 10p+14(p−1)≤1024.
Step 2: Simplify the inequality: 24p−14≤1024⟹24p≤1038.
Step 3: Solve for p: p≤1038/24=43.25. Since p must be an integer, max pointers p=43.
Step 4: The maximum number of search keys is p−1=43−1=42.
Answer: A
Question 3 · Database Management and WarehousingMCQ
Consider the following Assertion and Reason regarding B+ tree node capacity calculations:
Assertion (A): For a node of size 4 KB, with 10-byte tree pointers and 15-byte search keys, the maximum non-leaf fanout is 164.
Reason (R): The calculation for this fanout uses the inequality 25p≤4000, which yields p=160.
A.
Both A and R are true and R is the correct explanation of A
B.
A is true but R is false
C.
Both A and R are true but R is NOT the correct explanation of A
D.
A is false but R is true
Correct Answer:
B
Step-by-Step Solution
Key idea: This is an assertion-reason question testing the correct unit conversion and formula application for fanout.
Step 2: Apply the non-leaf formula: 10p+15(p−1)≤4096⟹25p−15≤4096⟹25p≤4111⟹p≤164.44.
Step 3: Maximum integer p=164. Assertion (A) is TRUE.
Step 4: Evaluate Reason (R). The reason claims the calculation uses 25p≤4000. This implies the student incorrectly converted 4 KB to 4000 bytes instead of 4096 bytes.
Step 5: Because the correct calculation uses 4096, the statement in (R) describing the calculation is FALSE.
Answer: A is true but R is false
Question 4 · Database Management and WarehousingMCQ
In a B+ tree where each leaf node can hold at most 5 entries, which of the following entry counts is impossible for a leaf node, assuming the tree contains more than one leaf node?
A.
2
B.
3
C.
4
D.
5
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a boundary case question about minimum occupancy in B+ tree leaf nodes, recognizable by the phrase "impossible" and the constraint "more than one leaf."
Step 1: Recall the structural rule for leaf nodes in a B+ tree. Every leaf node (except when the tree has only one leaf) must be at least half full.
Step 2: Calculate the minimum number of entries. For a leaf with maximum capacity pleaf=5, the minimum is ⌈pleaf/2⌉=⌈5/2⌉=3.
Step 3: Any leaf node must have between 3 and 5 entries. Therefore, 2 entries is impossible.
Answer: A
Question 5 · Database Management and WarehousingMCQ
In a B+ tree diagram, an internal node contains a single separator key $40$, pointing to a left leaf $L_1$ and a right leaf $L_2$. Assuming standard B+ tree properties where all actual data pointers are at the leaves, which of the following pairs of leaf contents is IMPOSSIBLE?
A.
L1: [10, 20], L2: [40, 50]
B.
L1: [20, 30], L2: [40, 60]
C.
L1: [10, 30], L2: [50, 60]
D.
L1: [30], L2: [40, 50, 60]
Correct Answer:
C
Step-by-Step Solution
Key idea: This is a boundary case question about B+ tree separator keys, recognizable by the need to identify which leaf configuration violates the structural rule that internal keys must be duplicated in the leaves.
Step 1: Recall the critical property of B+ trees: every key value that appears in an internal node as a separator must also appear in the leaf level to act as a valid data entry.
Step 2: The internal node has separator key 40. This means 40 must be present in one of the leaves (specifically, as the first key of the right leaf L2 in standard implementations).
Step 3: Evaluate the options:
A: 40 is in L2. Valid.
B: 40 is in L2. Valid.
C: 40 is missing from both leaves. L2 starts at 50. This violates the rule.
D: 40 is in L2. Valid.
Step 4: Option C is impossible because the separator key 40 is not present in the leaf level.
Answer: C
Question 6 · Database Management and WarehousingMCQ
Which of the following is IMPOSSIBLE for a non-leaf internal node in a B+ tree of order p=5 (assuming it is not the root)?
A.
It contains 2 search keys and 3 tree pointers.
B.
It contains 4 search keys and 5 tree pointers.
C.
It contains 3 search keys and 4 tree pointers.
D.
It contains 5 search keys and 6 tree pointers.
Correct Answer:
D
Step-by-Step Solution
Key idea: This is a boundary case question about B+ tree node capacities, recognizable by the need to identify which configuration violates the structural limits of a given order p.
Step 1: For a non-leaf node of order p=5, the maximum number of tree pointers is 5, and the maximum number of search keys is 5−1=4.
Step 2: The minimum number of tree pointers (for a non-root internal node) is ⌈5/2⌉=3, and the minimum number of search keys is 3−1=2.
Step 4: Option D violates the maximum capacity of p=5.
Answer: D
Question 7 · Database Management and WarehousingMCQ
A database system uses a block size of $2048$ bytes for its B+ tree index. The search key size is $16$ bytes, the data record pointer size is $8$ bytes, and the next-leaf pointer size is $8$ bytes. What is the maximum number of entries $p_{leaf}$ that can be stored in a leaf node?
A.
85
B.
86
C.
128
D.
127
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a construction question requiring application of the leaf node fanout formula with careful attention to all pointer types.
Step 1: Recall the leaf node capacity formula:
pleaf×(V+Pd)+Pnext≤B
where V = key size, Pd = data pointer size, Pnext = next-leaf pointer size, B = block size
Step 2: Substitute the given values:
B=2048 bytes
V=16 bytes
Pd=8 bytes
Pnext=8 bytes
pleaf×(16+8)+8≤2048
Step 3: Solve for pleaf:
pleaf×24+8≤2048
pleaf×24≤2040
pleaf≤242040=85
Step 4: Take the floor (must be integer):
pleaf=⌊85⌋=85
Answer: A
Question 8 · Database Management and WarehousingNAT
A B+ tree non-leaf node is built with a block size of $1024$ bytes. The tree pointer size is $8$ bytes and the search key size is $10$ bytes. What is the maximum number of tree pointers this non-leaf node can hold?
Correct Answer:
57.00
Step-by-Step Solution
Key idea: This is a casework calculation question testing the non-leaf node fanout formula.
Step 1: Recall the non-leaf node capacity inequality. A node with p pointers has p−1 keys.
p×Ptr+(p−1)×V≤B
Step 2: Substitute the given values: B=1024, Ptr=8, V=10.
8p+10(p−1)≤1024
Step 3: Simplify and solve for p:
8p+10p−10≤1024
18p≤1034
p≤181034≈57.44
Step 4: Since p must be an integer, take the floor:
p=57
Answer: 57.00
Question 9 · Database Management and WarehousingMCQ
A B+ tree index is built with the following specifications:\\
\\
Block size: $2$ KB\\
Tree pointer size: $6$ bytes\\
Search key size: $10$ bytes\\
\\
What is the maximum number of tree pointers $p$ that can be stored in a non-leaf node?
A.
128
B.
129
C.
2
D.
1
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a boundary-case question testing unit conversion and the non-leaf node fanout formula.
Step 1: Convert block size to bytes:
B=2 KB=2×1024=2048 bytes
Step 2: Recall the non-leaf node capacity formula:
p×Ptr+(p−1)×V≤B
where Ptr = tree pointer size, V = search key size
Step 3: Substitute the values:
B=2048 bytes
Ptr=6 bytes
V=10 bytes
p×6+(p−1)×10≤2048
Step 4: Simplify and solve:
6p+10p−10≤2048
16p≤2058
p≤162058=128.625
Step 5: Take the floor:
p=⌊128.625⌋=128
Answer: A
Question 10 · Database Management and WarehousingMCQ
In a B+ tree, if a non-leaf internal node has a maximum of p tree pointers, how many search keys does it contain?
A.
p−1
B.
p
C.
p+1
D.
2p
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a direct structural definition question for B+ trees.
Step 1: Recall the structure of a non-leaf node in a B+ tree. It acts as a routing guide.
Step 2: A node with p pointers separating different key ranges must have exactly p−1 search keys to define those boundaries.
Step 3: Therefore, the number of search keys is p−1.