4 lines · 235 B
-- The unverified-account sweep reads only never-verified users instead of scanning every user.
CREATE INDEX IF NOT EXISTS users_unverified ON users(account_id)
  WHERE email_verified_at IS NULL AND github_id IS NULL AND is_admin = 0;