Bug 41019


GemStone/S, 6.7.2, 6.7.1, 6.7, 6.6.5, 6.6.4,,, 6.6.3, 6.6.2, 6.6.1, 6.6, 6.5.8,, 6.5.7, 6.5.5, 6.5.4, 6.5.3, 6.5.2, 6.5.1, 6.5, 6.3.1, 6.3, 6.2.2, 6.2.1, 6.2, 6.1.6, 6.1.5, 6.1.x, 6.0.x, 5.x


Performance of ordering on multi-predicate indexed queries

When performing a multiple predicate indexed query, for the best performance, the predicates should be ordered so that the most restrictive predicate is evaluated first.  Predicates are evaluated from last to first (not the intuitive evaluation order), so the most restrictive predicate should be last in the query code.

For example, in the following query
  AllCustomers select:
    {:customer |
    (customer.status==#valid) & (customer.lastName=aName)}

The query predicate on lastName is performed first, resulting in a much smaller set that the second predicate must perform the query over.


To avoid perturbing existing tuned queries, we will not be changing this. Please examine your existing multi-term queries to ensure the ordering is optional for performance.


Last updated: 10/22/10