Performance of Single-Table Point Query Is Poor
Symptom
The customer expects the result of single-table query to be returned within 1 second. However, the execution takes more than 10 seconds.
Possible Causes
This problem occurs because incorrect row- and column-store tables are selected. In this scenario, the row-store table and B-tree index should be used.
Cause Analysis
- The execution information about the faulty SQL statements shows that most of the time is spent on CStore Scan.
- The base table contains more than one billion data records. Incremental data is imported to the database in batches every night, and a small amount of data is cleaned. In the daytime, a large number of concurrent query operations are performed. The query does not involve table association, and the values of returned results are not large.
Handling Procedure
- Create indexes on columns that are frequently searched. This can improve the search efficiency.
- Do not define redundant or duplicate indexes.
- Place the columns with better filtering performance in the front of the index.
- Create indexes on columns frequently following keywords such as ORDER BY, GROUP BY, and DISTINCT.
- Create indexes on columns that usually use the WHERE clause. This improves the efficiency of condition evaluations.
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