Partial and expression indexes

Index only the rows a query asks about, at a twentieth of the size, and index lower(email) so a case-insensitive login, and a case-insensitive UNIQUE, stop reading the whole table.

Checking your access…