• Data Warehouse Service

  1. Help Center
  2. Data Warehouse Service
  3. Developer Guide
  4. Data Import
  5. Doing ANALYZE and VACUUM to a Table

Doing ANALYZE and VACUUM to a Table

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 huge disk page fragments, which reduces the query efficiency. VACUUM FULL can restore disk page fragments and return them to the OS.

  1. Run the VACUUM FULL statement.

    Do VACUUM FULL to the product_info table:
    VACUUM FULL product_info

  2. Update table statistics.

    Do ANALYZE to the product_info table:
    ANALYZE product_info;