This topic provides the test results of online transaction processing (OLTP) performance of PolarDB for MySQL 8.0.

The optimizer of PolarDB for MySQL 8.0 supports the two modes: Cost-Based Optimization (CBO) and Rule-Based Optimization (RBO).

  • CBO: selects the execution plans that have the minimum costs by using a cost model based on statistics or real-time sample data.
  • RBO: determines the execution plans of queries based on the preset rules.

The PolarDB for MySQL 8.0 optimizer uses CBO as the primary mode, and uses RBO as a complementary mode in specific scenarios. You can run the ANALYZE command to collect the required statistics, or allow the optimizer to automatically collect the statistics. The statistics include the table size, number of records, density vector, hybrid histogram for a single column, number of distinct values (NDV), and null ratio. The cost model parameters of CBO can be configured in system tables to adapt to software and hardware environments. Meanwhile, the execution paths of queries can be locked or the search scope of CBO can be controlled to prevent the system from generating invalid execution plans.

Note For more information about test procedures, see OLTP performance test methods.

Primary node and a single read-only node

  • Figure 1. Test results of read-only performance of different specifications
    1
    Note In the preceding test, queries on all the ranges are disabled. This indicates that the range_selects parameter is set to 0. Therefore, the performance is high.
  • Figure 2. Test results of write-only performance of different specifications
    2
    Note In the preceding query:
    • Write QPS indicates the number of SQL requests (including BEGIN, COMMIT, INSERT, UPDATE, and DELETE) that are executed by the database per second.
    • Write TPS indicates the number of transactions that are executed by the database per second. A transaction is executed only after it is committed.

    For more information about how to test write QPS and write TPS, see Use SysBench to test the write performance.

  • Figure 3. Test results of read and write performance of different specifications
    3

Primary node and multiple read-only nodes

Figure 4. Test results of read-only performance
4
Note
  • The preceding figure shows the test results of read-only queries per second (QPS) when the clusters that are connected by using cluster endpoints are tested.
  • In the preceding test, the range_selects parameter is not specified. This indicates that queries on all the ranges are enabled by default.
  • In the preceding test, the cluster specification is 4 cores and 16 GB.