Updated on 2024-06-03 GMT+08:00
How do I create indexes in parallel?
Answer: Refer to the following method:
-- 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
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot