AnalyticDB for PostgreSQL is equipped with a vectorized execution engine developed by Alibaba Cloud. To optimize execution performance especially in OLAP scenarios, AnalyticDB for PostgreSQL combines technologies such as vectorized calculation and just-in-time (JIT) compilation to optimize the volcano model and make full use of modern hardware.

2021052401

Vectorized calculation model

AnalyticDB for PostgreSQL uses a vectorized execution engine to optimize the volcano model. Data is transferred by batches instead of by row. The vectorized calculation model is used together with the volcano model to improve the execution performance. Each operator pulls data in batch mode. Each batch contains multiple rows of data. Data can be stored based on priorities of columns or rows.

2021052402

JIT compilation

The execution engine of AnalyticDB for PostgreSQL supports JIT compilation and Low Level Virtual Machine (LLVM) for target-independent code generation. JIT compilation is applied to core operations to reduce the performance overhead due to the excessive abstraction of advanced languages. Expression computing and complex logical operations are optimized at the assembly level, which minimizes the instruction size and improves the execution speed of the engine by several times.

2021052403

Memory management optimization

AnalyticDB for PostgreSQL optimizes the efficiency of memory management based on hybrid transaction/analytical processing (HTAP) requirements.

  • Memory reuse: Each operator generates execution results of multiple rows and stores the execution results in a block of row or column memory. The memory is reused among operators as much as possible to avoid repeated memory applications or releases.
  • Batch memory allocation: The vectorized execution engine predicts the memory size for each operator and allocates memory for multiple operations at the same time by using the batch data model of the execution engine. This minimizes fragmented memory allocation. 2021052404
  • Minimum memory principle: To maximize memory performance, AnalyticDB for PostgreSQL reduces unnecessary request, reset, and release operations on the memory.