Use the Terraform script to initialize resources and create an ECS instance and AnalyticDB for PostgreSQL.
The following figures show the command:



The created Terraform script is shown in the figure:

Initialize another hard disk and mount the hard disk as shown in the figure:

Generate 100 GB of data by using the script provided on GitHub.
The script is shown in the following figures:


The following figure shows the concurrently generated data:

The generated data occupies 106 GB.

Create a bucket to import data.
Execute the script to import data to OSS.
Script link: https://github.com/alibabacloud-howto/solution-adbpg-labs/blob/master/benchmark-tpc-h/upload_tpch_oss.sh
You must modify the following parameters:
export OSS_ENDPOINT=oss-cn-hongkong-internal.aliyuncs.com
export OSS_BUCKET=oss://adbpg-tpch-bechmark-hongkong
export AK_ID=<Access Key>
export AK_SECRET=<Access Secret>



View the imported data in OSS:



PostgreSQL client.
wget https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20230202/kqvv/adbpg7_client_package.el7.x86_64.tar.gz
Switch to the bin directory and run the following command to log in to AnalyticDB for PostgreSQL, indicating that it functions normally. If not, the dependency package is missing:
There's a pitfall! ! ! ! Some operating systems lack the dependency library software.
Check whether the dependency library rpm -q compat-openssl10 is missing.
yum install -y compat-openssl10

The missing dependency package requires the following libraries to be installed:



Configure password-free login operations for AnalyticDB for PostgreSQL.
gp-3ns3xq7em6bifhoc0-master.gpdb.rds.aliyuncs.com:5432:adbpg:adbpg:N1cetest


Create a table
Script link: https://github.com/alibabacloud-howto/solution-adbpg-labs/blob/master/benchmark-tpc-h/tpch-ddl.sql
Script content:


The script needs to be modified in the following parts:

Run the import script. It takes a long time to import data:
./psql -h<AnalyticDB PostgreSQL connection string> -Uadbpg adbpg -f /mnt/load_tpch_oss_data.sql



The following parts need to be modified:
export ADB_PG_URL=
export ADB_PG_USER=adbpg

Download the SQL statements required for the query:
Link: https://github.com/alibabacloud-howto/solution-adbpg-labs/tree/master/benchmark-tpc-h/tpch_query


View the results generated by the benchmark query.


ApsaraDB - August 31, 2021
ApsaraDB - May 20, 2024
Alibaba Cloud New Products - August 10, 2020
ApsaraDB - October 29, 2024
ApsaraDB - October 20, 2020
ApsaraDB - March 12, 2020
PolarDB for PostgreSQL
Alibaba Cloud PolarDB for PostgreSQL is an in-house relational database service 100% compatible with PostgreSQL and highly compatible with the Oracle syntax.
Learn More
AnalyticDB for PostgreSQL
An online MPP warehousing service based on the Greenplum Database open source program
Learn More
ApsaraDB RDS for PostgreSQL
An on-demand database hosting service for PostgreSQL with automated monitoring, backup and disaster recovery capabilities
Learn More
Database for FinTech Solution
Leverage cloud-native database solutions dedicated for FinTech.
Learn MoreMore Posts by ApsaraDB