Slow performance with LIKE operator in sql query
Hello,
I've the below query which is causing slow performance in my project.
select * from formulation f, subject s
where f.fieldid=s.subjectid and facilityid in (select u_fid from facility where id = 'admin' and (upper(s.crewid) like upper('%[id]%') or upper(s.crewdesc) like upper('%[id]%') or upper(f.sapid) like upper('%[id]%'))
The problem in the above code is LIKE operator use and then '% %' also being used with that.
Can anyone please suggest some better option in this context to tune the query?
Thanks in advance.
Best Regards,