In computing, an index refers to a position-based identifier used to access elements quickly in an ordered collection such as arrays or lists. In databases, an index refers to a structure that speeds up queries by mapping key values to table locations. Both uses support efficient data retrieval, though they operate in different contexts.
Why it matters
Indexes—whether in arrays or databases—improve access performance and support predictable algorithms. Poor indexing strategies can lead to inefficiency, slow queries, or out-of-bounds errors.
Examples
Accessing array[0] uses a positional index, while looking up a user by email uses a database index. Lessons on Indexes Explained cover database indexing.