GateAI
File Organization and Indexing

GATE CSE 2011 · Q39

MCQ2 marksEasy

Time

Consider a relational table rr with sufficient number of records, having attributes A1,A2,…,AnA_1, A_2, \dots, A_n and let 1≤p≤n1 \le p \le n. Two queries Q1 and Q2 are given below. Q1: πA1,…,Ap(σAp=c(r))\pi_{A_1, \dots, A_p}(\sigma_{A_p = c}(r)) where cc is a constant Q2: πA1,…,Ap(σc1≤Ap≤c2(r))\pi_{A_1, \dots, A_p}(\sigma_{c_1 \le A_p \le c_2}(r)) where c1c_1 and c2c_2 are constants The database can be configured to do ordered indexing on ApA_p or hashing on ApA_p. Which of the following statements is TRUE?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) Hashing will outperform ordered indexing on Q1, but not on Q2

File Organization and Indexing
  • Q1 is an equality/point query (exact match σAp=c\sigma_{A_p = c}). Hashing provides direct access with average time complexity O(1)O(1), which is generally faster than ordered indexing (e.g., B+\text{B}^+ tree) which has O(log⁡N)O(\log N) lookup time. Thus, hashing outperforms ordered indexing for Q1.

  • Q2 is a range query (σc1≤Ap≤c2\sigma_{c_1 \le A_p \le c_2}). Ordered indexing stores keys in sorted order, which allows finding the starting key and traversing sequential leaf nodes efficiently. Standard hashing does not preserve order, so a range query would require scanning all buckets/records. Thus, ordered indexing outperforms hashing for Q2.

Therefore, hashing will outperform ordered indexing on Q1, but not on Q2.

Hence, the correct option is (C).

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 File Organization and Indexing previous year question is Q39 of the GATE CSE 2011 paper. Find more GATE CSE PYQs on File Organization and Indexing 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 File Organization and Indexing 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.

File Organization and Indexing in GATE CSE

File Organization and Indexing has 17 GATE CSE PYQs across 17 papers from 2011 to 2026. 3 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2011.

How GATE tests File Organization and Indexing

More from GATE CSE 2011

Share this solution

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

GateAI solution cardGATE CSE 2011 · Q39 · MCQ

Consider a relational table r with sufficient number of records, having attributes A1, A2, , An and let 1 ≤ p ≤ n. Two queries Q1 and Q2 are given below. Q1: A1, , Ap( Ap = c(r)) where c is a constant Q2: A1, , Ap( c1 ≤ Ap ≤ c2(r)) where c1 and c2 are constants The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the following statements is TRUE?

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.