Query Optimization with Statistics Example

The following structured query provides an example for optimizing statistics:

select score(1) from tab where contains(txt, 'freedom', 1)  > 0 and author = 'King' and year > 1960;

Assume the following:

In this situation, Oracle Text can execute this query more efficiently by first scanning a b-tree index range on the structured predicate (author = ‘King’), then accessing a table by rowid, and then applying the other two predicates to the rows returned from the b-tree table access. Note: When statistics are not collected for a Oracle Text index, the CBO assumes low selectivity and index costs for the CONTAINS predicate.