Updated on 2024-05-20 GMT+08:00

Data Partition Query Optimization

Partitioned tables help you query data by using predicates based on partition keys. For example, if a table uses month as the partition key, as shown in Figure 1, you need to access all data in the table (full table scan). If the table is redesigned based on date, the original full table scan is optimized to partition scan. When the table contains a large amount of data and has a long historical period, the performance is greatly improved due to data reduction, as shown in Figure 2.

Figure 1 Example of a partitioned table
Figure 2 Example of partition pruning