关键词 > Database

HW2_Part2: Indexes

发布时间:2025-09-24

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

HW2_Part2: Indexes

Q1: Sorting a table by a subset of columns, then using binary search, is a way to speed up retrieval of data satisfying range conditions on the sort columns. What are the advantages of indexes over sorting? (多选)

A. We can create many indexes on the same table, thereby supporting predicates on a diverse set of columns.

B. Using an index is typically more efficient than binary search.

Q2: Using an index to process a specific query is always faster than processing the query without using an index. (T/F)

True

False

Q3: Tree indexes support the following types of SQL predicates (i.e., we can use the index to efficiently retrieve data satisfying the predicate). (多选)

A. Equality predicates on a single column.

B. Equality predicates on multiple columns.

C. Inequality predicates.

D. SQL LIKE predicates.

Q4: Hash indexes support the following types of SQL predicates (i.e., we can use the index to efficiently retrieve data satisfying the predicate).(多选)

A. Equality predicate on a single column.

B. Equality predicates on multiple columns.

C. Inequality predicates.

D. SQL LIKE predicates.

Q5: We cannot have more than one clustered index per table. (T/F)

True

False

Q6: The tree indexes seen in class perform steps to ensure that no index node is underfull and the tree remains balanced. Without these steps, which of the following problems may occur over time?(多选)

A. The index may store incorrect data.

B. Paths from the index root to a leaf node may become very long, making access inefficient.

C. The index becomes space-inefficient (i.e., it consumes much more space than necessary).

D. The index tree turns into a forest.

Q7: In which situations is extendible hashing preferable over static hashing?(多选)

A. The data changes dynamically.

B. The data contains many entries with the same index search key.

Q8:In which situations is extendible hashing preferable over static hashing?(多选)

A. The data changes dynamically.

B. The data contains many entries with the same index search key.

Q9: Which are advantages of linear hashing over extendible hashing?(多选)

A. No overflow pages.

B. Space is always used efficiently.

C. Insertions are always efficient.

D. We save the cost of accessing the directory.

Q10: We can use at most one index when processing a single query. (T/F)

True

False

Q11: When selecting an index to use for query processing, the following factors can be important.(多选)

A. The types of query predicates.

B. Properties of the data.

C. The type of the index.