Siren Federate includes different join strategies: “Broadcast Join” and “Hash Join”. Each one has its pros and cons and the optimal performance will depend on the scenario. By default, the Siren Federate planner will try to automatically pick the best strategy, but it might be best in certain scenarios to pick manually one of the strategies.
The Broadcast Join is best when filtering a large index with a small set of documents. The Hash Join is fully distributed and is designed to handle large joins. It scales horizontally (based on the number of nodes) and vertically (based on the number of cpu cores).
Siren Federate provides a fully distributed join algorithm: the Hash Join. The Hash Join is designed for leveraging multi-core architecture. This is achieved by creating many small data partitions during the Project phase. Each node of the cluster will receive a number of partitions that are dependent of the number of cpus. Partitions are independent from each other and can be processed independently by a different join worker thread. During the join phase, each worker thread will join tuples from one partition. The number of join worker threads scales automatically with the number of cpu cores available.
The Hash Join is performed in two phases: build and probe. The build phase creates a in-memory hash table of one of the relation in the partition. The probe phase then scans the second relation and probes the hash table to find the matching tuples.
Numeric vs String Attributes
Joining numeric attributes is more efficient than joining string attributes. If you are planning to join attributes of
string, we recommend to generate a murmur hash of the string value at indexing time into a new attribute, and use
this new attribute for the join. Such index-time data transformation can be easily done using
Tuple Collector Settings
Tuple Collectors are sending batches of tuples of fixed size. The size of a batch
has an impact on the performance. Smaller batches will take less memory but will increase
cpu times on the receiver side since it will have to reconstruct a tuple collection from many
small batches (especially for sorted tuple collection). By default, the size of a batch of tuple is
set to 1,048,576 tuples (which represents 8mb for a column of long datatype). The size can be configured
using the setting key
siren.io.tuple.collector.batch_size with a integer value representing the
maximum number of tuples in a batch.