Database-Management-System
March 8, 2025
BFS-and-DFS
March 8, 2025
Database-Management-System
March 8, 2025
BFS-and-DFS
March 8, 2025

Database-Management-System

Question 16

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,…,ApAp=c(r)) where c is a constant
    Q2: πA1,…,Apc1≤Ap≤c2(r)) where c1 and c2 is a constants

The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the following statements is TRUE?

A
Ordered indexing will always outperform hashing for both queries
B
Hashing will always outperform ordered indexing for both queries
C
Hashing will outperform ordered indexing on Q1, but not on Q2
D
Hashing will outperform ordered indexing on Q2, but not on Q1.
Question 16 Explanation: 
Hashing works well on the “equal” queries, while ordered indexing works well better on range queries.
For example, consider B+ tree, once you have searched a key in B+; you can find range of values via the block pointers pointing to another block of values on the leaf node level.
Correct Answer: C
Question 16 Explanation: 
Hashing works well on the “equal” queries, while ordered indexing works well better on range queries.
For example, consider B+ tree, once you have searched a key in B+; you can find range of values via the block pointers pointing to another block of values on the leaf node level.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x