SQL Performance (MOSC)

MOSC Banner

Slow performance with LIKE operator in sql query

edited Mar 4, 2016 4:03AM in SQL Performance (MOSC) 6 commentsAnswered

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,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center