• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. Developer Guide
  4. Tutorial: Importing Data from OBS to a Cluster
  5. Step 5: Improving Query Efficiency After Data Import

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

  1. Run VACUUM FULL on the product_info table.

    VACUUM FULL product_info
    VACUUM

  2. Update statistics of the product_info table.

    ANALYZE product_info;
    ANALYZE