This topic describes the design, procedure, and result of the TPC Benchmark-H (TPC-H) test for PolarDB-X Clustered Columnar Indexes (CCIs).
Background information
TPC-H is a benchmark that is widely used to evaluate the analytic query capabilities of databases. The benchmark is developed and released by Transaction Processing Performance Council (TPC). In the TPC-H benchmark, 22 complex SQL queries are performed on eight tables. Most queries contain joins on several tables, subqueries, and GROUP BY clauses.
In this topic, the TPC-H test is implemented based on the TPC-H benchmark test but cannot meet all requirements of the TPC-H benchmark test. Therefore, the test results described in this topic cannot be compared with the published results of the TPC-H benchmark test.
Test design
Amount of test data
In this topic, 100 GB of data is used for the test, which indicates that the scalar factor is 100. The following list describes the amount of data in each major table:
The LINEITEM table contains approximately 600 million rows of data.
The ORDERS table contains 150 million rows of data.
The PART_SUPP table contains 80 million rows of data.
Instance specifications for the TPC-H test
Node specifications | Number of nodes | Size of data set |
8 cores and 32 GB of memory | 2 or 4 | 100 GB |
16 cores and 64 GB of memory | 2, 3, 4, or 6 | 100 GB |
ECS instance type for stress testing
ecs.g7.4xlarge (16 vCPUs and 64 GB of memory)
Procedure
Step 1: Create an ECS instance for stress testing
Create an Elastic Compute Service (ECS) instance that is used to prepare data and perform stress testing.
The ECS instance must be deployed in a virtual private cloud (VPC). Record the name and the ID of the VPC for subsequent use. You must deploy all database instances that are described in subsequent steps in this VPC.
We recommend that you create an ECS instance that runs the CentOS operating system and enable the public IP address of the ECS instance.
Step 2: Create a PolarDB-X instance for stress testing
Create a PolarDB-X instance. For more information, see Create a PolarDB-X instance.
Make sure that the PolarDB-X instance and the ECS instance reside in the same VPC.
You must add the internal endpoint of the ECS instance to the whitelist of the PolarDB-X instance.
Step 3: Adjust instance parameters
To achieve optimal performance in stress testing, adjust some parameters of the compute node of the PolarDB-X instance.
Set the XPROTO_MAX_DN_CONCURRENT parameter to 4000. For more information, see Set parameters.
Connect to the PolarDB-X instance by using CLI and execute the following SQL statements in the same session to disable logging, CPU statistic sampling, and 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
Enable port 4121 for the security group of the ECS instance. For more information, see Add a security group rule.
Log on to the ECS instance and run the
bash -c "$(curl -fsSL https://benchmark-boot.oss-cn-hangzhou.aliyuncs.com/setup.sh)"
command to install Benchmark Boot. For more information, see Download and install Benchmark Boot.Access http://{Public IP address of the ECS instance}:4121 by using a browser. If the Benchmark Boot homepage appears, Benchmark Boot is installed.
Step 5: Prepare data
On the Benchmark Boot homepage, choose PolarDB-X connection. Then, click Submit.
. On the page that appears, configure the host IP address, port, username, password, and TPC-H library, and set the library creation mode to AUTO to create aChoose PolarDB-X instance.
, set the size of the input dataset to 100 GB and the number of physical shards to 16, and then click Submit to import 100 GB of test data to the primaryNoteAfter the data is imported, Benchmark Boot automatically executes the analyze table statement to collect statistics.
After the data is imported, execute the following SQL statements on the primary PolarDB-X instance to create a CCI. For more information, see Create and use a CCI.
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;
NoteYou can execute the
show columnar index
statement to view the status of the CCI. For more information, see SHOW COLUMNAR INDEX.It takes about 45 minutes to create a CCI.
Step 6: Add a read-only column store instance
Add a read-only column store instance to the primary PolarDB-X instance. For more information, see Add a read-only column store instance.
You must also add the internal endpoint of the ECS instance to the whitelist of the read-only PolarDB-X column store instance.
Step 7: Run the TPC-H test
On the Benchmark Boot homepage, choose
. On the page that appears, configure the TPC-H library name and set the library creation mode to AUTO to create a connection string for the read-only column store instance. Then, click Submit.On the Benchmark Boot homepage, choose
. On the page that appears, select All Queries, specify a task description, and click Submit to execute the 22 query statements for the TPC-H test.On the Benchmark Boot homepage, choose
to view the test results.NoteA 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
The following table describes the test results. Unit: seconds.
Query | 2*8 Cores, 32 GB | 4*8 Cores, 32 GB | 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 duration | 99.82 | 48.55 | 50.31 | 33.00 | 25.54 | 20.56 |