setLoadFactor

setLoadFactor(loadFactor: Integer) updating;

The setLoadFactor method of the Btree class modifies the default load factor for a Btree-based collection; that is, for dictionaries and sets. (For more details, see "Collections Behavior and Tuning", in Chapter 4 of the JADE Developer’s Reference.)

The value specified in the loadFactor parameter determines the ratio of entries (as a percentage factor) that are moved to a new block when a Btree block splits.

Statistically, a 66 percent load factor provides optimal loading when entries are added in random key order and a higher load factor (for example, 95 percent) provides better loading when entries are added in sequential key order.

The default value, specified at the collection class level, is 66 (percent). For details about specifying a sequential load pattern for Btree classes if you do not want the default random load pattern, see "Tuning Collection Classes", in Chapter 3 of the JADE Development Environment User’s Guide.

You can call the setLoadFactor method at any time, even on a non-empty collection. When you change the load factor of a collection, an immediate restructure of the Btree does not occur.

To adjust the load factor at the class level, use the Expected Population text box on the Tuning sheet of the Define Class dialog.