Skip to content
live35 ptscloses 11/14/2026, 10:07:33 AM

40× slower because of lower()

A login lookup went 25ms → 1s after Friday's deploy. The table has an index on email. Postgres ignores it.

The scene

Reported: POST /login p95 = 1.1s since Friday's deploy (was 25ms). users has 4.2M rows.

EXPLAIN ANALYZE SELECT * FROM users WHERE lower(email) = lower($1);
Seq Scan on users  (cost=0.00..98412.00 rows=21000 width=212) (actual time=812.4..1044.0)
  Filter: (lower(email) = 'x@y.com'::text)
\d users
Indexes:
    "users_pkey" PRIMARY KEY, btree (id)
    "users_email_key" UNIQUE, btree (email)
  • Friday's PR: "make email login case-insensitive". The diff only changed the WHERE clause.

Diagnoses — hidden until the incident closes

Sign in to post your root-cause diagnosis.