Databases Reference
In-Depth Information
Exhibit 21-10. Hashing search keys. (
continued
)
Query 4 is an equality match on the Budget, while Query 5 is a range query
over DeptName. The DBA should create an index on Budget to support the
secondary search key Budget. Because Query 5 is executed more fre-
quently than Query 4, the DBA should create a B+ tree rather than a hashed
index to support the secondary search key DeptName because hashed
indexes do not support range queries. A linking table will be needed
because there already is an index file structure for Department.
Phase 4: Build Composite Indexes
A composite index is an index built on a composite search key contain-
ing more than one field. Composite search keys can be useful if queries,
such as the following, are executed frequently:
Select * from Project where 8/9/98 < StartDate and EndDate < 9/9/99
The DBA creates a composite tree index <StartDate, EndDate>. Then, the
DBMS can use the index to locate addresses of records by examining one
Search WWH ::




Custom Search