dagblog.
← Archive

Database indexes


Do you work with data in a database? Do you use indexes, or have no idea what they are?
 If you aren’t quite sure why database indexes matter, Jakub Vrána’s article
 
 Using database indexes
covers the basics and gives a practical example.

In short, indexes address a problem with operating on table data. Data is inserted in no particular order. 
 When you need to work on unordered data, say to find a particular record or sort
 by a chosen criterion, you have to go through every record. That’s a poor solution in terms
 of speed and load, so databases let you create indexes on a column or group of columns.
 The database uses these indexes for tasks such as searches and joins. They greatly reduce the time and work required
 to run a query.

Database indexes are often overlooked when implementing a data model, even though they’re a key
 factor in how quickly you can work with the data in a larger 
 table. Keep in mind that optimizing SQL queries is essential, and indexes 
 on the relevant columns play a critical role.

Medium version

Related articles

Related CZ Podcast episodes