All Products
Search
Document Center

Lindorm:BUILD INDEX

Last Updated:Mar 28, 2026

BUILD INDEX triggers a secondary index build after you submit an asynchronous index building task. It applies only to LindormTable versions later than 2.2.16 and equal to or earlier than 2.6.3.

Version compatibility

The behavior of BUILD INDEX differs across LindormTable versions:

LindormTable versionBehavior
> 2.2.16 and ≤ 2.6.3After submitting an asynchronous index building task, run BUILD INDEX separately to trigger the build.
> 2.6.3BUILD INDEX is not required. Index creation is handled automatically after you initiate the async build request.

Syntax

BUILD INDEX [ index_identifier ]
    ON table_identifier
ParameterDescription
index_identifierName of the index to build. Run SHOW INDEX to list all indexes on a table.
table_identifierName of the table for which to build the index.

Usage notes

Concurrency limits

LindormTable enforces the following limits on concurrent index building tasks:

  • A maximum of 2 index building tasks can run at the same time across all tables.

  • Only 1 index building task can run per table at a time.

This means two tasks can run simultaneously only if each targets a different table.

Note

If you submit two or more tasks for the same table, only the first task succeeds. Additional tasks fail immediately. To run another task on that table, wait until the first task reaches INDEX_STATE = ACTIVE and INDEX_PROGRESS = 100%, then submit a new BUILD INDEX statement.

Similarly, if two tasks are already running on two different tables, any additional tasks fail until the two tasks are complete.

Index build status

Use SHOW INDEX to monitor index build progress. The following fields indicate the current state of a build:

FieldValueMeaning
INDEX_STATEBUILDINGThe task failed to start due to a concurrency conflict.
INDEX_STATEACTIVEThe index was built successfully and is ready for use.
INDEX_PROGRESSN/AThe task failed because the concurrency limit was exceeded.
INDEX_PROGRESS100%The build completed successfully.

Example

Build a secondary index named idx1 on the table test:

BUILD INDEX idx1 ON test;

Verify the result

Run the following statement to confirm the index was built successfully:

SHOW INDEX FROM test;

The index is ready when INDEX_STATE is ACTIVE and INDEX_PROGRESS is 100%.