Search code examples
javascalahazelcasthazelcast-imap

Validate if hazelcast indexes are used


I am using Hz PredicateBuilder to query Hz maps with query on nested object's attribute. Have created an index on the nested field too in config file.

EntryObject e = new PredicateBuilder().getEntryObject();
Predicate idPredicate = e.get( "id" ).equal( id );
Predicate predicate = e.get( "rel.id" ).equal( rel.id).and(idPredicate);
return personMap.values( predicate );

Where rel is an object with id attribute and is an attribute of Person object.

 indexes = [
            {
              attribute = id
              isOrdered = false
            },
            {
              attribute = rel.id
              isOrdered = false
            }
          ]

Correct records are returning but want to make sure if this query is using the index. Is there a way to make sure this query is using the index? (Any informational message or something). Worked with DB2 before and debug level shows these messages. Any help is much appreciated! Thanks in advance.


Solution

  • According to the Hazelcast documentation - Management section. No statistic object for Indexes is listed. The listed statistics MBeans are the different distributed objects.

    At the same time if index is not hit this will result in sequential deserialization of the keys and potentially also values if we are queuing the values as well. With enough records in memory 100 000+ probably even less the performance difference will be more than noticeable.