Database Index

A database index is a data structure that speeds up reads by letting the database find rows without scanning the whole table, at the cost of extra storage and slower writes.

Indexes work like a book's index: instead of reading every page, the database jumps straight to matching rows. They're essential for fast filtering, sorting, and joins on large tables.

Common index types in PostgreSQL include B-tree (the default, great for equality and ranges), GIN (for full-text and JSON), and partial indexes for subsets of rows.

Indexes also matter for security and performance together — for example, indexing the columns referenced by row-level security policies keeps policy checks fast.

Related terms

See it in practice

Kolaybase gives you PostgreSQL, auth, storage, and a REST API in minutes.

Get started