- Documentation
Database Workshop
User guide (Document Database for MongoDB)
Data management
SQL window
Index management
SQL window
Index management
Index management
This topic describes how to visually create, and delete indexes in the command execution window of the Database Workshop (DBW) console to achieve full lifecycle management of indexes.
Prerequisites
- An instance for Document Database for MongoDB has been created and its root account password has been set. For detailed steps, see Creating an instance.
Precautions
- Deleting or modifying collections in the system database is not supported.
- Deleting the default index _id_ in the collection is not supported.
- Creating or deleting an index consumes certain CPU resources. To reduce the impact of creating or deleting an index on your instance, we suggest taking the following measures:
- Create or delete indexes during off-peak hours.
- Enable the Background option to create indexes in the background, avoiding operation blocking caused by index creation.
- When creating or deleting indexes, the index change operations are executed serially, that is, the creation, modification, or deletion of the previous index must be completed on all nodes before proceeding to the next index creation or deletion operation.
Create an index
tip
It is not recommended to create an index in the system database.
- On the top menu bar of the Data interaction platform page, click the icon after Database and select the target database.
icon after the database, select the target database.
- In the visual area of the Data interaction platform, expand the Collection, right-click the index, and select Create index.
- On the Create index@Database tab, configure the index parameters.
- In the Execute SQL dialog box, confirm the SQL statement for creating the index.
Query an index
- On the top menu bar of the Data interaction platform page, click the icon after Database and select the target database.
icon after the database, select the target database.
- In the visual area of the Data interaction platform, expand the Index, right-click the target index, and select Query index.
- On the Session tab, click Execute.
In the Execution result area, you can view the detailed index information.
Delete an index
warning
- The default index _id_ can not be deleted.
- Deleting the index of the system database is not allowed.
- On the top menu bar of the Data interaction platform page, click the icon after Database and select the target database.
icon after the database, select the target database.
- In the visual area of the Data interaction platform, expand the Index, right-click the target index, and select Delete index.
- In the Execute SQL dialog box, confirm deletion of the SQL statement for the index.
Edit the TTL value of an index
When creating an index, you can edit the TTL value of the index if the TTL feature is enabled.
- On the top menu bar of the Data interaction platform page, click theicon next to the database and select the target database.
- In the visual area of the Data interaction platform, expand Collection and Index, click the icon after the target index, or right-click the target index, and Select Edit index TTL value.
- On the Edit index TTL@Database tab, click Edit after the ExpireAfterSeconds Parameter to Modify the ExpireAfterSeconds Parameter value. The value range is [0, 2147483647], in second(s).
- Click the ✅ icon to submit the modified data.
- In the Execute SQL dialog box, confirm the SQL statement to be executed.
- After confirming that the information is correct, click Execute.
Related APIs
Last updated: 2025.11.10 20:18:15