Tune Application Logic

Follow these guidelines for tuning applications.

  • Create indexes on all columns that are used to join tables.

    If an index is not available for a join query, GemFire XD builds a hash table and uses the hash join strategy to improve query performance. However, joins that return a large number of rows can fail with an OVERFLOW_TO_DISK_UNSUPPORTED exception if GemFire XD does not have enough runtime memory to build the hash table. If you receive this error, check the joined columns and create indexes as necessary, or use an optimizer hint to change the selected join strategy. See Overriding Optimizer Choices.

  • Avoid expensive join queries by denormalizing and adding constraints.
  • Use prepared statements for all operations to reduce latency.
  • Design queries so that results are pruned to the smallest result set first.
  • Use sufficient indexes to optimize frequently executed queries. Because indexes add to the footprint of your application, make sure that the indexes you add provide a meaningful performance benefit.
  • Minimize the use of transactions. GemFire XD provides atomicity and isolation for single rows even without transactions.
  • Keep the duration of transactions low, and keep the number of rows involved in a transaction as low as possible. GemFire XD acquires locks eagerly, and long-lasting transactions increase the probability of conflicts and transaction failures.
  • Minimize the use of REPEATABLE_READ transactions.