This page describes the design, procedure, and results of a TPC-H benchmark test for PolarDB-X Clustered Columnar Indexes (CCIs) using a 100 GB dataset. Use the results to estimate query performance across different node configurations before provisioning your cluster.
This test is based on the TPC Benchmark-H (TPC-H) specification but does not meet all TPC-H requirements. The results cannot be compared with published TPC-H benchmark results.
Test results at a glance
The table below shows the total query time (in seconds) across all 22 queries for each node configuration. Lower is better.
| Configuration | Total time (s) |
|---|---|
| 2 × 8 cores, 32 GB | 99.82 |
| 4 × 8 cores, 32 GB | 48.55 |
| 2 × 16 cores, 64 GB | 50.31 |
| 3 × 16 cores, 64 GB | 33.00 |
| 4 × 16 cores, 64 GB | 25.54 |
| 6 × 16 cores, 64 GB | 20.56 |
A warm-up is required if the TPC-H test is run for the first time. Run several rounds of the test until results stabilize. The values in this table are the stable results.
Background
TPC-H is a decision-support benchmark developed and released by the Transaction Processing Performance Council (TPC). It consists of 22 complex SQL queries on 8 tables. Most queries involve multi-table joins, subqueries, and GROUP BY clauses.
Test design
Dataset
The test uses a 100 GB dataset (scale factor = 100). The three largest tables contain:
-
LINEITEM: approximately 600 million rows
-
ORDERS: 150 million rows
-
PARTSUPP: 80 million rows
Node configurations
| Node specifications | Number of nodes | Dataset size |
|---|---|---|
| 8 cores, 32 GB memory | 2 or 4 | 100 GB |
| 16 cores, 64 GB memory | 2, 3, 4, or 6 | 100 GB |
Stress test machine
The stress test runs on an Elastic Compute Service (ECS) instance of type ecs.g7.4xlarge (16 vCPUs, 64 GB memory).
Prerequisites
Before you begin, make sure you have:
-
An Alibaba Cloud account with permissions to create ECS and PolarDB-X instances
-
Access to the Alibaba Cloud console
Run the TPC-H test
Step 1: Create an ECS instance
Create an ECS instance to use as the stress test client.
Deploy the ECS instance in a virtual private cloud (VPC) and record the VPC name and ID. All database instances in this test must reside in the same VPC. Use a CentOS image and enable a public IP address for the instance.
Step 2: Create a PolarDB-X instance
Create a PolarDB-X instance in the same VPC as the ECS instance.
Add the internal IP address of the ECS instance to the whitelist of the PolarDB-X instance.
Step 3: Tune instance parameters
Adjust the compute node parameters of the PolarDB-X instance for optimal benchmark performance.
-
Set XPROTO_MAX_DN_CONCURRENT to
4000. For instructions, see Set parameters. -
Connect to the PolarDB-X instance using the CLI and run the following SQL statements in a single session to disable logging, CPU profiling, and background statistics collection:
set global RECORD_SQL = false; set global MPP_METRIC_LEVEL = 0; set global ENABLE_CPU_PROFILE = false; set global ENABLE_BACKGROUND_STATISTIC_COLLECTION = false; set global ENABLE_STATISTIC_FEEDBACK = false;
Step 4: Install Benchmark Boot
-
Open port 4121 in the security group of the ECS instance. For instructions, see Add a security group rule.
-
Log in to the ECS instance and run the following command to install Benchmark Boot:
bash -c "$(curl -fsSL https://benchmark-boot.oss-cn-hangzhou.aliyuncs.com/setup.sh)"For more information, see Download and install Benchmark Boot.
-
Open
http://<Public IP of ECS instance>:4121in a browser. If the Benchmark Boot homepage loads, the installation is complete.
Step 5: Load test data
-
On the Benchmark Boot homepage, go to Stress Test > Database Connection > Configure Database Connection. Enter the host IP address, port, username, password, and TPC-H library name. Set the library creation mode to AUTO, and click Submit.
-
Go to Stress Test > TPCH > Import TPC-H. Set the dataset size to 100 GB and the number of physical shards to 16, then click Submit to import the data into the primary PolarDB-X instance.
After the import completes, Benchmark Boot automatically runs
ANALYZE TABLEto collect optimizer statistics. -
After the import completes, create CCIs on the primary PolarDB-X instance by running the following SQL statements. For more information, see Create and use a CCI.
CCI creation takes approximately 45 minutes. Run
show columnar indexto check progress. For more information, see SHOW COLUMNAR INDEX.create clustered columnar index `nation_col_index` on nation(`n_nationkey`) partition by hash(`n_nationkey`) partitions 1; create clustered columnar index `region_col_index` on region(`r_regionkey`) partition by hash(`r_regionkey`) partitions 1; create clustered columnar index `customer_col_index` on customer(`c_custkey`) partition by hash(`c_custkey`) partitions 64; create clustered columnar index `part_col_index` on part(`p_size`) partition by hash(`p_partkey`) partitions 64; create clustered columnar index `partsupp_col_index` on partsupp(`ps_partkey`) partition by hash(`ps_partkey`) partitions 64; create clustered columnar index `supplier_col_index` on supplier(`s_suppkey`) partition by hash(`s_suppkey`) partitions 64; create clustered columnar index `orders_col_index` on orders(`o_orderdate`,`o_orderkey`) partition by hash(`o_orderkey`) partitions 64; create clustered columnar index `lineitem_col_index` on lineitem(`l_shipdate`,`l_orderkey`) partition by hash(`l_orderkey`) partitions 64;
Step 6: Add a read-only column store instance
Add a read-only column store instance to the primary PolarDB-X instance.
Add the internal IP address of the ECS instance to the whitelist of the read-only column store instance as well.
Step 7: Run the test
-
On the Benchmark Boot homepage, go to Stress Test > Database Connection > Configure Database Connection. Enter the TPC-H library name for the read-only column store instance, set the library creation mode to AUTO, and click Submit.
-
Go to Stress Test > TPCH > Run TPCH. Select All Queries, enter a task description, and click Submit to run all 22 TPC-H queries.
-
Go to Test Result > TPCH to view the results.
A warm-up is required if the TPC-H test is run for the first time. We recommend that you run several rounds of the test to obtain stable results.
Test results
Unit: seconds. Lower is better. Run several rounds until results stabilize, and use the stable values for comparison.
| Query | 2×8C32G | 4×8C32G | 16C64G×2 | 16C64G×3 | 16C64G×4 | 16C64G×6 |
|---|---|---|---|---|---|---|
| Q1 | 5.9 | 3.99 | 4.37 | 1.6 | 1.22 | 0.86 |
| Q2 | 2.41 | 1.68 | 1.63 | 1.15 | 1.04 | 0.86 |
| Q3 | 4.18 | 2.13 | 2.43 | 1.77 | 1.20 | 0.88 |
| Q4 | 3.72 | 1.02 | 0.94 | 0.78 | 0.48 | 0.44 |
| Q5 | 5.63 | 3.12 | 3.27 | 2.05 | 1.68 | 1.4 |
| Q6 | 0.41 | 0.38 | 0.42 | 0.18 | 0.15 | 0.13 |
| Q7 | 5.47 | 2.94 | 2.93 | 2.08 | 1.72 | 1.34 |
| Q8 | 3.61 | 2.31 | 1.98 | 1.81 | 1.68 | 1.51 |
| Q9 | 13.6 | 6.91 | 7.46 | 4.93 | 3.85 | 3.11 |
| Q10 | 6.36 | 3.12 | 3.5 | 2.31 | 1.73 | 1.26 |
| Q11 | 1.51 | 0.64 | 0.74 | 0.53 | 0.49 | 0.35 |
| Q12 | 1.86 | 0.82 | 0.78 | 0.57 | 0.40 | 0.35 |
| Q13 | 8.85 | 4.29 | 4.44 | 2.6 | 1.64 | 1.2 |
| Q14 | 0.94 | 0.58 | 0.7 | 0.51 | 0.38 | 0.31 |
| Q15 | 1.26 | 0.76 | 0.88 | 0.59 | 0.47 | 0.37 |
| Q16 | 2.3 | 1 | 1.19 | 0.75 | 0.61 | 0.46 |
| Q17 | 1.86 | 0.75 | 0.69 | 0.47 | 0.43 | 0.49 |
| Q18 | 8.43 | 4.18 | 4.43 | 3.16 | 2.19 | 1.6 |
| Q19 | 4.92 | 2.16 | 1.86 | 1.07 | 1.02 | 0.73 |
| Q20 | 1.88 | 1.34 | 1.17 | 0.73 | 0.78 | 0.73 |
| Q21 | 12.05 | 3.18 | 3.11 | 2.38 | 1.72 | 1.57 |
| Q22 | 2.67 | 1.25 | 1.39 | 0.98 | 0.66 | 0.61 |
| Total | 99.82 | 48.55 | 50.31 | 33.00 | 25.54 | 20.56 |