Which of the following best explains why database indexes are used?
Think about how indexes help find data faster, like an index in a book.
Indexes help the database find rows faster by avoiding scanning the entire table.
You have a table with millions of rows and a query that filters by a range of dates. Which index type is most suitable?
Consider which index supports range queries efficiently.
B-tree indexes are designed to handle range queries efficiently by maintaining sorted order.
Your application experiences slow read queries on a large table. You add multiple indexes. What is a potential downside of adding many indexes?
Think about what happens when data is inserted or updated in indexed tables.
Each index must be updated on writes, which can slow down insert, update, and delete operations.
Which statement correctly describes a key difference between clustered and non-clustered indexes?
Consider how data is physically stored in clustered indexes.
Clustered indexes define the physical order of data rows; non-clustered indexes contain references to data rows.
You have a table with 100 million rows and a single-column B-tree index on a 4-byte integer column. Approximately how much disk space will the index consume if each index entry requires 20 bytes?
Multiply the number of rows by the size per index entry and convert bytes to gigabytes.
100 million rows × 20 bytes = 2,000,000,000 bytes ≈ 2 GB.