|Programming Data-Aware Procedures and Result Processors / Using the Procedure Provider API|
GemFire XD includes a data-aware procedure example that you can compile, deploy, and execute from a dedicated client application.
As described in Designing GemFire XD Databases, data-aware procedures are frequently used for handling many-to-many relationships where partitioned data cannot be colocated. Procedures can be used in this case to perform multiple queries and then join the data programmatically.
In other cases, the selection of partitioning columns can cause certain types of queries to perform expensive nested-loop joins instead of hash joins. Using data-aware procedures enables you to hash the results of multiple queries in the procedure body. The example nested loop join procedure, installed in the /examples/joinquerytodap directory of your installation, shows an example query where performance can be improved by using a data-aware procedure. This example procedure uses hashing of query results, and also shows how to avoid excessive object creation in a query caused by repeatedly casting the results of a column. See the README.txt file for this example for instructions on compiling, installing, and running the example.