Currently below query takes 1 sec with 100 data in PostgreSQL.It maybe takes a long time when data comes in a bunch so how can I make this query faster?
Query:
select distinct u.firstname,u.lastname,u.email,u.profile_pic
from user u
where (lower (u.firstname) like '%ab%'
or lower(u.email) like '%ab%'
or lower(u.lastname) like '%ab%' )
and u.id != 2
and u.active = true;
Thanks in advance.