Posts about indexes
Articles, guides and engineering notes about indexes from the Relyt One team.
3 articles

Why is COUNT(*) slow in Postgres? We measured it on 10 million rows
Why SELECT count(*) in PostgreSQL reads the whole table, and what to do instead. Measured on 10 million rows on Postgres 17.11: sequential vs parallel vs index-only scans, how an UPDATE of 1% of rows made an indexed count 40 to 50 times slower until VACUUM ran, count(*) vs count(1), planner estimates, capped counts, and the write cost of trigger-maintained counter tables.

Postgres JSONB indexes: jsonb_ops vs jsonb_path_ops vs expression indexes, and the queries each one ignores
Which index to create for a JSONB column in PostgreSQL: the default GIN operator class, jsonb_path_ops, or a B-tree expression index. Measured on 1 million rows on Postgres 17.11: query times, index sizes and insert cost, why WHERE payload->>'key' = ... never uses a GIN index, why ? ignores jsonb_path_ops, and the partial-index statistics trap.

Why Postgres isn't using your index: seven causes, with EXPLAIN output you can reproduce
You created the index and EXPLAIN still shows a sequential scan. Seven reasons PostgreSQL ignores an index (functions, casts, wildcards, selectivity, stale statistics, column order, tiny tables), each with a reproduction and a fix.