Got it

Statistics collection

Latest reply: Aug 15, 2019 00:53:27 526 1 13 0 3

This post is related to the statistics collection. Please see more details further down.


The query engine of LibrA uses a cost-based query optimizer. When the query plans of an SQL statement are generated, the optimizer uses statistics to evaluate the execution cost of each query plan and selects the one with the lowest cost. Therefore, the accuracy and reliability of statistics directly affect the performance of execution plans and queries.


After a large number of add, delete, and update operations on a database table, statistics collected based on the table data will expire. Therefore, you need to periodically collect statistics on a database table.


For example, to collect statistics on the sc_etcptjd table, run the following SQL statement:


ANALYZE sc_etcptjd;


Pay attention to the following when collecting statistics:


l Set the execution interval of statistics collection to once a month, and select a night period (from 20:00 to 6:00 the next day) when system load is low. Running the crontab command to periodically execute the GSQL script can be used as a reference.


l To collect statistics while reclaiming the storage space of a table, use the VACUUM FULL ANALYZE statement.


l Before collecting statistics, test and evaluate the operation time and ensure that the operation can be completed within a specified time window.


Statistics collection
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.