Db2 Text Search multiple predicates
If a query contains multiple predicates, consider the following limitations depending on how the predicates are organized.
UNION versus OR operators
Query performance might improve by using UNION instead of OR to combine multiple predicates.
Using a JOIN
Text search functions can be
a predicate in an outer join, with limitations for LEFT OUTER JOIN
and FULL OUTER JOIN. For these cases a text search predicate can only
be applied if the search on this text index can be joined back with
the primary key of its base table. For example, the following type
of query is supported:
select place.placenum, location.description from place
LEFT OUTER JOIN location on (location.mgrid = place.ownerid)
where
(location.description is null and contains(place.description, 'Paris')=1 ) The CONTAINS and SCORE functions are not supported as a predicate in a LEFT OUTER JOIN or FULL OUTER JOIN.