
This is a regular “data quiz”. Follow it on LinkedIn. Test your knowledge or learn something new.
Today Question:
What is the purpose of an index in a database?
A) Increase write speed
B) Increase read speed
C) Reduce data size
D) Replace keys
Correct Answer: B
Explanation
A database index is a data structure that significantly speeds up searching and reading data from tables. It works similarly to an index in a book – instead of scanning the entire table from beginning to end, the database can use the index to quickly find the required records. An index contains references to the physical location of data in the table, organized in an optimal structure (usually B-tree). When a SELECT query with a WHERE condition is executed on an indexed column, the database can immediately jump to the correct location and load only the necessary records. This dramatically reduces query execution time, especially with large tables. Indexes are crucial for OLTP system performance, where frequent queries on specific records are executed. However, it’s important to know that indexes also have disadvantages – they take up additional disk space and slow down INSERT, UPDATE, and DELETE operations because the index must also be updated.
Subscribe to Our Newsletter
