Databases Articles

All articles

Partial and Expression Indexes in PostgreSQL

Use PostgreSQL partial indexes (WHERE clauses) and expression indexes to index only what matters: soft deletes, queues, case-insensitive search and JSON fiel...

Why Your Index Isn't Being Used: Functions, Casts, LIKE and Low Selectivity

The common reasons a database ignores an index: non-sargable predicates, functions on columns, implicit casts, leading wildcards, OR, low selectivity and sta...

When Indexes Hurt: Write Overhead, Bloat and Unused Indexes

Indexes are not free. Measure write amplification, find unused and duplicate indexes in MySQL and PostgreSQL, handle bloat and create indexes without locking...

Reading EXPLAIN Plans to Check Index Usage (MySQL and PostgreSQL)

Learn to read EXPLAIN and EXPLAIN ANALYZE output in MySQL and PostgreSQL: scan types, key, rows, cost, filesort, and how to spot missing indexes.

Hash, GIN, GiST and BRIN: Choosing the Right Index Type

Beyond B-trees: when to use hash, GIN, GiST, SP-GiST and BRIN indexes in PostgreSQL, plus MySQL full-text and spatial indexes, with examples.

Covering Indexes and Index-Only Scans Explained

Make queries faster with covering indexes: answer queries from the index alone, INCLUDE columns in PostgreSQL and SQL Server, and the visibility map.

Composite Indexes and the Leftmost Prefix Rule

How multi-column indexes work, the leftmost prefix rule, choosing column order (equality first, then range), and composite indexes for ORDER BY.

Clustered vs Non-Clustered Indexes: What's the Difference?

Clustered vs non-clustered (secondary) indexes in MySQL, SQL Server and PostgreSQL: how rows are stored, key lookups, primary key choice and performance.

B-Tree Indexes: How Databases Actually Store and Search Indexes

How B-tree and B+tree indexes work inside MySQL InnoDB and PostgreSQL: pages, fan-out, tree height, range scans, page splits and why lookups stay fast.

Database Indexes Explained: How They Make Queries Fast (With Visuals)

A visual guide to database indexes: full table scans vs index seeks, how an index is structured, what it costs on writes, and when to add one.