Database Index

A index is a special database table that can be used to speed up database queries.

Think of it like a table of contents. The database index lets you jump straight to the data you're looking for instead of scanning through every row.

Indices aren't free: storing the index takes space, and every time the database is updated the index has to be updated to match.

Consider adding an index if you have fields that are frequently used in database lookups, especially if the database is mostly read and rarely updated.

Reviewed by Stephen Cognetta, CEO of Aced. Last updated: June 7, 2026

What's next?

If you're ready to start applying these concepts to some problems, check out our mock coding interview questions.

They mimic a real interview by offering hints when you're stuck or you're missing an optimization.

Try some questions now

. . .