GATE CS 2011 · SQL Queries

MCQ · 2 marks · Problem DBMS-SQL-0108

Consider a relational table r with sufficient number of records, having attributes \(A_{1}, A_{2},..., A_{n}\) and let \(1\leq p\leq n\) . Two queries Q1 and Q2 are given below. \(Q1:\pi _{A_{1}....A_{n}}(\sigma _{A_{p}=c}(r))\) where c is a constant \(Q2:\pi _{A1....A_{n}}(\sigma _{c_{1}\leq A_{p}\leq c_{2}}(r))\) where \(c_{1}\) and \(c_{2}\) are constants The database can be configured to do ordered indexing on \(A_{p}\) or hashing on \(A_{p}\).Which of the following statements is TRUE?
  1. A
    Ordered indexing will always outperform hashing for both queries
  2. B
    Hashing will always outperform ordered indexing for both queries
  3. C
    Hashing will outperform ordered indexing on Q1, but not on Q2
  4. D
    Hashing will outperform ordered indexing on Q2, but not on Q1.

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2141/gate2011-39

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com