Question 23. The database interface of a library allows searching only for a single attribute (such as Title or Author ) in each query. Your friend decided to extend it’s functionality and wrote an algorithm that allows searching for books that satisfy multiple predicates over single attributes in conjunction. He tells you the algorithm reuses the already implemented query functionality and works by intersecting the results ( book id’s ) of queries over single attributes. Which of the following assumptions on your friend’s algorithm are plausible? a) Its worst-case run-time necessarily increases exponentially with respect to the number of attributes in the query. b) Its worst-case run-time depends on the length of the longest result of the single-attribute queries. c) It might be implemented using an join. d) It might be implemented using sorting.
Question 23. The
or Author ) in each query. Your friend decided to extend it’s functionality and wrote an
searching for books that satisfy multiple predicates over single attributes in conjunction. He tells you the algorithm
reuses the already implemented query functionality and works by intersecting the results ( book id’s ) of queries
over single attributes.
Which of the following assumptions on your friend’s algorithm are plausible?
a) Its worst-case run-time necessarily increases exponentially with respect to the number of attributes in the
query.
b) Its worst-case run-time depends on the length of the longest result of the single-attribute queries.
c) It might be implemented using an join.
d) It might be implemented using sorting.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps