FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
What is a Database Index? How It Works and When You Need It
NewsSystems

What is a Database Index? How It Works and When You Need It

via Dev.toKenta Takeuchi13h ago

This article was originally published on bmf-tech.com . What is an Index? A mechanism to quickly retrieve records stored in a table. Consider a query with an O(n) problem like the following: SELECT * FROM users WHERE first_name = ‘Tom’ To improve the performance of this query, you can add an index as follows: ALTER TABLE users ADD INDEX (first_name) Advantages and Disadvantages Advantages Improved speed of data reading and retrieval Disadvantages Increased storage size Decreased write speed When creating or updating data, indexes are also added or updated simultaneously, leading to the above disadvantages. Index Patterns Standard (Applied to a single column) ALTER TABLE users ADD INDEX (first_name) Partial Index An effective pattern when you want to improve performance while suppressing storage increase. Example of applying an index to only the first 4 bytes: ALTER TABLE users ADD INDEX (first_name(4)) Multi-column Index (Also called composite or compound index) ALTER TABLE users ADD I

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles

One hundred curl graphs
News

One hundred curl graphs

Lobsters • 12h ago

Brompton Electric T-Line Folding Electric Bicycle Review: Pocket-Sized Pedal Power
News

Brompton Electric T-Line Folding Electric Bicycle Review: Pocket-Sized Pedal Power

Wired • 13h ago

News

Gothub is live

Lobsters • 14h ago

I Built the Tool I Wish I Had When I Started My Open Source Journey
News

I Built the Tool I Wish I Had When I Started My Open Source Journey

Medium Programming • 14h ago

Razer Boomslang 20th Anniversary Mouse Review: For Collectors
News

Razer Boomslang 20th Anniversary Mouse Review: For Collectors

Wired • 14h ago

Discover More Articles