Optimizing usage of the equality operator

Db2® optimizes queries that use the CONTAINS function along with the equality operator (=).

Use the equality operator rather than the comparison operators when you use the CONTAINS function, because Db2 does not optimize queries that use the CONTAINS function along with comparison operators (<, >, <=, and >=). The CONTAINS function can return either 0 or 1.

For example, instead of using the query CONTAINS()>0, replace the comparison operator (>) with the equality operator (=). The modified query is CONTAINS()=1.