Product Documentation

c-treeACE V10.0 Update Guide

Previous Topic

Next Topic

Improved Performance of Descending Range Searches

We observed unnecessary operations comparing a range performed in ascending order versus descending order. When the key values that satisfy a range are contiguous, the range logic can stop searching whenever an internal get next key operation finds a key that does not satisfy the range criteria. The descending range logic, PRVRNG()/PRVVRNG(), did not take advantage of this optimization, and made unnecessary calls to low-level key routines.

This modification applies the optimization to the descending order range routines. The key values satisfying a range will be contiguous if:

  • All the criteria are equality constraints, CTIX_EQ.

    or

  • All but the last criteria are equality constraints and the last of the criteria does not use a NOT condition (i.e., it is not a CTIX_NE or CTIX_NOTBET).

Trailing segments, if any, that have no range criteria do not affect whether or not the keys satisfying the range criteria are contiguous.

TOCIndex