Step 7: Optimizing the Query Efficiency After Data Import
After data is imported, run the ANALYZE statement to generate table statistics. The execution plan generator uses the statistics to generate the most efficient query execution plan.
If a large number of rows were updated or deleted during import, run VACUUM FULL before ANALYZE. A large number of update and delete operations generate a lot of disk page fragments, reducing the query efficiency. VACUUM FULL can restore disk page fragments and return them to the OS.
- Run VACUUM FULL on the product_info table.
1
VACUUM FULL product_info
VACUUM
- Update statistics of the product_info table.
1
ANALYZE product_info;
ANALYZE
Last Article: Step 6: Analyzing and Handling Import Errors
Next Article: Step 8: Stopping GDS
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.