Bug 44493

GemStone/S 64 Bit

3.2.2, 3.2.1, 3.2

3.2.3

With new indexing API, indexes only used for first predicate of multiple-predicate query

With multiple predicate indexed queries, the first predicate is always evaluated first, and for performance should be the most restrictive.

When using the classic SelectBlock query API, the second and later predicates are evaluated until the result set is 1000 or fewer results, at which point any further queries are performed by interation, not using indexes.

The new Indexing API using GsQuery, however, inadvertently omitted the threshold, and as a result, all predicates after the first one are evaluated iteratively, which provides none of the index performance benefit.

Workaround

If the first predicate is sufficiently restrictive, the performance from iteration may not be noticeable.

You may wish to write queries (or leave existing queries) with SelectBlock syntax in versions in which this bug is present.

Splitting the predicates into separate queries and using set logic on the results may also work around this problem.


Last updated: 7/29/14