Indexes are automatically kept current with the region data they reference. The region attribute IndexMaintenanceSynchronous specifies whether the region indexes are updated synchronously when a region is modified or asynchronously in a background thread.

Index Maintenance Behavior

Asynchronous index maintenance batches up multiple updates to the same region key. The default mode is synchronous, since this provides the greatest consistency with region data.

An index on the Passenger name field will have different memory space requirements in the cache than the Flight origin field even though they are both String field types. The internal data structure selected by GemFire for index storage will depend on the field’s level in the object. In this example, name is a top-level field and an index on name can be stored as a compact index. Since origin is a second-level field, any index that uses origin as the indexed expression will be stored as a non-compact index.

Compact Index

A compact index has simple data structures to minimize its footprint, at the expense of doing extra work at index maintenance. This index does not support the storage of projection attributes.

Currently compact indexes are only selected only supports the creation of an index on a region path. In addition, the following conditions must be met:

Index maintenance is synchronous.

The indexed expression is a path expression.

The FROM clause has only one iterator. This implies that there is only one value in the index for each region entry and it is directly on the region values (not supported with keys, entries).