This topic describes how to load a sample dataset to your database to help you experience or test AnalyticDB for PostgreSQL instances.

If you set Sample Data to Loaded when you create an instance, you can skip this topic.

Prerequisites

  • An AnalyticDB for PostgreSQL instance is created. For more information, see Create an instance.
  • An AnalyticDB for PostgreSQL database is connected to. For more information, see Connect to a database.

Precautions

  • If your instance is in elastic storage mode, the sample dataset is supported only for V6.3.10.3 or later. If your instance is in Serverless mode, the sample dataset is supported only for V1.0.4.0 or later. For more information about how to update the minor engine version of your instance, see Update the minor engine version.
  • The sample dataset is about 10 GB in size. Make sure that your instance has sufficient storage space.
  • The sample dataset contains a database named adb_sampledata_tpch. Make sure that your instance does not have a database with the same name. Otherwise, the dataset may fail to be loaded.
  • It may take 6 to 8 minutes to load the sample dataset. During this period, operations on your instance such as adding nodes or changing node specifications may be affected.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. On the Basic Information page, choose Sample Dataset > Load Dataset.
  5. In the Load Sample Dataset message, click OK.
  6. Connect to your database and switch to the adb_sampledata_tpch database. Execute the SELECT count(*) FROM lineitem; statement to query the number of rows in the sample dataset. The complete sample dataset contains about 5.99 million rows of data.
Note If the sample dataset fails to be loaded, you can load the sample dataset again.

References

What to do next

Query data