Optimizing Operators
A query statement requires passing through multiple operator steps before producing the final result. It is quite common for the overall query performance to degrade due to certain operators taking excessively long times. These operators become the bottlenecks of the entire query. To fix this, you can run the EXPLAIN ANALYZE or PERFORMANCE command to find the bottleneck.
As illustrated in the following execution details, the HashAgg operator's execution duration constitutes (66167 – 56217)/66878 = 14.8% of the total time, while the Foreign Scan operator takes up 56217/66878 = 84% of the total time. Here, the Foreign Scan operator emerges as the bottleneck for this particular query. When optimizing performance, priority should be given to enhancing this operator, such as using partitioned tables.
Furthermore, when joining two tables with substantial data volumes, selecting NestLoop often leads to suboptimal performance from this operator. To significantly boost efficiency, you are advised to disable NestLoop by setting enable_nestloop to off and instead use HashJoin.
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.
For any further questions, feel free to contact us through the chatbot.
Chatbot