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
- Log on to the AnalyticDB for PostgreSQL console.
- In the upper-left corner of the console, select the region where the instance resides.
- Find the instance that you want to manage and click its ID.
- On the Basic Information page, choose .
- In the Load Sample Dataset message, click OK.
- Connect to your database and switch to the
adb_sampledata_tpch
database. Execute theSELECT 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.