⬅︎ Back to Quick PostgreSQL optimization story
TryCREATE INDEX u_first_name_index ON u (lower(first_name));or a variation thereof.(Ah, I just noticed you wrote "without any indices". You probably already know this, then. I'll post it anyway - for the search engines.)You could also use a shadow column maintained by a trigger, but that's an evil solution, only to be used in almost never-met circumstances.
Comment
Try
CREATE INDEX u_first_name_index ON u (lower(first_name));
or a variation thereof.
(Ah, I just noticed you wrote "without any indices". You probably already know this, then. I'll post it anyway - for the search engines.)
You could also use a shadow column maintained by a trigger, but that's an evil solution, only to be used in almost never-met circumstances.