After you create TPC-H OSS external tables and TPC-H tables, run the following commands to import data into the tables:

submit job insert overwrite into customer select*from oss_customer;
submit job insert overwrite into lineitem select*from oss_lineitem;
submit job insert overwrite into nation select*from oss_nation;
submit job insert overwrite into region select*from oss_region;
submit job insert overwrite into supplier select*from oss_supplier;
submit job insert overwrite into orders select*from oss_orders;
submit job insert overwrite into part select*from oss_part;
submit job insert overwrite into partsupp select*from oss_partsupp;  

Query the progress of an import task

Import tasks will take longer to complete for large amounts of data. You can run the following command to check whether an import task is complete:

show job status;          

Interrupt an import task

If you need to interrupt a running import task due to an exception, run the following cancel command:

cancel job '$job_id';       

ANALYZE TABLE

After data is imported, AnalyticDB for MySQL automatically collects statistics of certain data and generates execution plans on a regular basis.

When you import data for the first time or if your queries have low performance, you can execute the ANALYZE TABLE ALL statement to collect statistics of the full data and improve execution plans.