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:\pi_{A_i...A_p}(\sigma_{A_p=c(r)})\) where c is a constant
\(Q2:\pi_{A_i...A_p}(\sigma_{c_1\le A_p\le c_2}(r))\) where c1 and c2 are constant
The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the following statements is TRUE?
1
Ordered indexing will always outperform hashing for both queries
2
Hashing will always outperform ordered indexing for both queries
3
Hashing will outperform ordered indexing on Q1, but not on Q2
4
Hashing will outperform ordered indexing on Q2, but not on Q1