indexing

  • A composite index where column order changed execution by 40x

    When filtering by an equality condition on one column and a range condition on another, the order of columns in a composite index is the difference between an…

  • An index invisible test that exposed an unindexed subquery

    Before dropping what appeared to be an unused composite index on our transactions table, we followed the rule of making the index invisible first in our staging database.…

  • Eleven indexes that existed only for reporting

    Indexes on production tables serving queries that no user request ever makes. An index that serves only reporting is paying a write cost on every insert to make…

  • Write latency after dropping an index

    Eleven indexes removed from production tables, and the write path measured before and after. The median saving is trivial and the tail is not, which is the usual…

  • The reporting database that is not a replica

    A read replica serving reports, and reports that want a different schema. Eleven indexes on production tables that exist only for reporting.

  • Write latency, before and after eleven indexes

    Eleven reporting indexes dropped from production tables, measured on the write path. The median saving is trivial and the tail is not, which is the usual shape of…

  • A search index rebuilt because the mapping changed again

    A field that had to change type for the second time in eighteen months, and a rebuild that is now routine. The rebuild time is what makes a…

  • A schema change on a table nobody can lock

    A column type change on a table taking four hundred writes a second, and an ALTER that estimates four hours.

  • The archive table nobody could delete from

    900 million rows, a retention policy, and a legal question nobody had asked. A table that grows forever because deleting from it might be illegal.

  • A generated column that removed a JSON scan

    A key inside a JSON column filtered on four hundred thousand times a day, promoted without changing any application code. The optimiser matching a functional expression to a…