Help Center/ GaussDB/ Developer Guide(Centralized_V2.0-8.x)/ FAQ/ How do I create indexes in parallel?
Updated on 2025-08-19 GMT+08:00
How do I create indexes in parallel?
Answer: GaussDB supports parallel index creation to improve the index creation efficiency.
Example:
-- Set maintenance_work_mem based on the actual situation. gaussdb=#SET maintenance_work_mem = '8GB'; -- Create a table. gaussdb=#CREATE TABLE table_name (col1 int, col2 int); -- Change the number of threads for creating indexes for a table based on the actual situation. gaussdb=#ALTER TABLE table_name SET (parallel_workers=4); -- Create an index. gaussdb=#CREATE INDEX index_name ON table_name(col1); -- Reset the parallel_workers parameter for the table. gaussdb=#ALTER TABLE table_name RESET (parallel_workers); -- Delete the index. DROP INDEX index_name; -- Drop the table. gaussdb=#DROP TABLE table_name;
Parent topic: FAQ
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.