CompTIA Tech+ (FC0-U71)Data and Database FundamentalsMedium
A database administrator notices that queries searching the LastName column of a large Customers table are running very slowly. Which database feature should be created on that column to speed up search performance?
- AA view
- BA foreign key
- CA trigger
- DAn index
Show answer & explanationAnswer & explanation
Correct answer: D. An index
An index creates a fast lookup structure on a column, similar to a book's index, dramatically speeding up search and retrieval operations. A foreign key enforces relationships, a view is a saved virtual query, and a trigger automatically executes actions in response to data changes.
Why the other options are wrong
- A. A view is a saved query result, not a performance-boosting structure.
- B. A foreign key links tables together but does not speed up searches.
- C. A trigger runs automated actions on data changes, not related to search speed.
Database Index
A database object that creates a fast-access structure on one or more columns to speed up search and retrieval operations.
- Works like a book index for quick lookups
- Speeds up reads but can slow down writes/inserts
- Commonly created on columns frequently used in WHERE or ORDER BY clauses
Memory trick: An index is a book's table of contents — jump straight to the page.