WebSphere eXtreme Scale Administration Guide > Configure WebSphere eXtreme Scale



Configure the HashIndex


The HashIndex plug-in supports both the MapIndex and MapRangeIndex interfaces. Defining and using indexes properly can significantly improve query performance.

The following attributes can be used to configure HashIndex using either the ObjectGrid deployment descriptor XML file or a programmatic approach:


Single-attribute HashIndex vs. composite HashIndex

When the AttributeName property of HashIndex includes multiple attribute names, the HashIndex is a composite index. Otherwise, if it includes only one attribute name, it is a single-attribute index. For example, the AttributeName property value of a composite HashIndex may be "city,state,zipcode”. It includes three attributes delimited by commas. If the AttributeName property value is only “zipcode” that only has one attribute, it is a single-attribute HashIndex.

Composite HashIndex provides an efficient way to look up cached objects when search criteria involve many attributes. However, it does not support range index and its RangeIndex property must set to “false”.

For more information, see Composite HashIndex.


Relationship HashIndex

If the indexed attribute of single-attribute HashIndex is a relationship, either single- or multi-valued, the HashIndex is a relationship HashIndex. For relationship HashIndex, the RangeIndex property of HashIndex must set to “false”.

Relationship HashIndex can speed up queries that use cyclical references or use the IS NULL, IS EMPTY, SIZE and MEMBER OF query filters. See query optimization using indexes in the Programming Guide.


Range HashIndex

When the RangeIndex property of HashIndex is set to “true”, the HashIndex is a range index and can support the MapRangeIndex interface. A MapRangeIndex supports functions to find data using range functions, such as greater than, less than, or both, while a MapIndex only supports equals functions. For a single-attribute index, the RangeIndex property can be set to “true” only if the indexed attribute is of type Comparable. If the single-attribute index will be used by query, the RangeIndex property must set to “true” and the indexed attribute must be of type Comparable. For relationship HashIndex and composite HashIndex, the RangeIndex property must set to “false”.

The following is a summary for using range index.

Table 1. Support for range index
HashIndex type Supports range index
Single-attribute HashIndex: indexed key or attribute is of type Comparable Yes
Single-attribute HashIndex: indexed key or attribute is not of type Comparable No
Composite HashIndex No
Relationship HashIndex No


Query optimization using HashIndex

Define and using indexes properly can significantly improve query performance. WebSphere eXtreme Scale queries can use built-in HashIndex plug-ins to improve performance of queries. Although using indexes can significantly improve query performance, it may have a performance impact on transactional map operations.



Parent topic

Configure WebSphere eXtreme Scale


+

Search Tips   |   Advanced Search