All Products
Search
Document Center

OpenSearch:Build an application that supports online multi-table joins

Last Updated:Mar 31, 2026

Online multi-table joins let you run SQL queries across multiple related tables in real time, without pre-joining or denormalizing data. This guide walks you through creating an OpenSearch High-performance Search Edition instance that supports this feature, from purchasing an instance to testing your first join query.

Prerequisites

Before you begin, ensure that you have:

How it works

OpenSearch High-performance Search Edition uses a distributed backend. For multi-table joins to work, records from different tables that need to be joined must reside on the same node — because joins are executed locally within each column (shard) and never performed across columns.

The routing field controls this placement: when building the index, the engine hashes each record's routing field value and stores all records with the same hash in the same column. During a query, the QRS worker sends the SQL query to each column, each column executes the join locally, and the QRS worker aggregates the per-column results and returns them to the user.

This means the routing field must contain the join key. If you join on a non-primary key, configure that join key as the routing field so that records with matching values always land on the same column.

Create an instance

  1. Go to the OpenSearch High-performance Search Edition console and click Create Instance.

    image

  2. Select your instance specifications. Set Edition to High-performance Search Edition.

    SettingDescription
    Billing methodSubscription or Pay-as-you-go
    Region and zoneSelect the region and zone closest to your users
    Application nameEnter a custom name
    Cluster preferenceStorage-optimized Dedicated Cluster (required for multi-table joins)
    Storage capacityAccept the default or specify a custom value
    Computing resourcesAccept the default or specify a custom value

    image

    image

  3. Confirm your order, accept the terms of service, and click Activate Now.

    image

  4. Wait for the instance to appear in the instance list with a status of Pending.

    image

Configure the application

Define the application schema

  1. On the instance list page, find your instance and click Configure in the Actions column.

    image

  2. Choose a method to define your application schema: For field type reference, see Application schema in OpenSearch High-performance Search Edition.

    The total number of tables cannot exceed eight.
    MethodWhen to use
    From a templateReuse a previously saved schema
    By uploading a documentUpload a JSON data file; the system generates an initial schema that you then refine
    From a data sourceSync from RDS or MaxCompute; the system generates an initial schema from the source table schema, reducing manual setup. See Data source configuration
    ManuallyDefine fields from scratch; used in this guide to create two tables

    image

Configure the index schema

Configure the index schema separately for each table.

image

Keep the following field type restrictions in mind:

  • FLOAT, FLOAT_ARRAY, DOUBLE, and DOUBLE_ARRAY fields cannot be set as index fields.

  • TEXT and SHORT_TEXT fields cannot be set as attribute fields.

Set a field as an attribute field to use it in SELECT, WHERE, or ORDER BY clauses.

For guidance on configuring the index schema and choosing analysis methods, see Index schema and Text analyzers.

Configure the routing field

image

Connect a data source

  1. Click Add Data Source and select the data source type. Supported data source types:

    image

    image

  2. After completing the data source configuration, click Completed.

    image

  3. On the instance details page, wait until the offline application status changes to Normal. The application is ready for queries once it reaches this state.

Test with a SQL join query

After the application status reaches Normal and the application is published, go to the Search Test page to run test queries.

image

Limitations

The following limitations apply when using online multi-table joins:

LimitationReason
Only Exclusive Storage-optimized clusters support multi-table joinsThe join-per-column architecture requires dedicated storage nodes with co-located data
Only SQL queries are supportedThe distributed join execution is built on the SQL engine
Custom analyzers are not supportedCustom analyzers are incompatible with the multi-table index structure
Sort configurations are not supportedPre-configured sort policies conflict with per-column join aggregation; use ORDER BY in your SQL query instead
Search result display settings are not supportedResult formatting is controlled by the SQL query output
Exclusive Storage-optimized cluster instances cannot be upgraded or downgradedThe cluster type is fixed at creation to maintain storage-optimized guarantees

What's next