I have an application and it sometimes uses sql that has the below.
FROM T194 WHERE (
(((T194.C210000000 LIKE ('wsp' || '%'))AND (0 = 0)) OR ('wsp' = ' '))
AND (((T194.C200000020 LIKE (' ' || '%')) AND (0 = 0)) OR (' ' = ' '))
AND (T194.C400127400 = 'ATT.TICKETING')
AND (T194.C400129100 = 0)
AND (1 = 1)
AND (T194.C179 != 'OI-38B8EB16E3B711DEA613000084A752D8')
ORDER BY 1 ASC
When I do the query it takes 90 secs, but if I change T194.C179 != to T194.C179 = , remove the ! it takes 2 seconds to run and uses the correct index. It appears the ! does a wild search on the column C179. I've never messed with ! so not sure why it is in the sql in the 1st place.
Any thoughts on why the application would use ! would be helpfull.