🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Intermediate

What is Index?

A data structure that improves the speed of data retrieval operations on database tables at the cost of additional storage.

Indexes work like a book index — they allow the database to find rows without scanning the entire table. Without an index, a query on a million-row table checks every row. With an index, it jumps directly to matching rows.

Types include B-tree (default, good for ranges), hash (exact matches), GIN (full-text search), and GiST (geometric data). Over-indexing slows down writes since indexes must be updated on every INSERT/UPDATE.

Related Terms

Connection Pool
A cache of database connections that can be reused, avoiding the overhead of creating new connections for each request.
Deadlock
A situation where two or more transactions permanently block each other by each holding locks that the other needs.
Database Index Types
Different index structures (B-tree, Hash, GIN, GiST, BRIN) optimized for various query patterns and data types.
Partitioning
A technique of dividing large database tables into smaller, more manageable segments while maintaining a single logical table.
Prepared Statement
A pre-compiled SQL template that uses parameters instead of literal values, preventing SQL injection and improving performance.
B-Tree Index
The default index type in most databases that organizes data in a balanced tree structure for efficient searching, sorting, and range queries.
View All Databases Terms →