Execution engine

更新时间:
复制 MD 格式

AnalyticDB for PostgreSQL uses a vectorized execution engine developed by Alibaba Cloud. The engine combines vectorized calculation and just-in-time (JIT) compilation to deliver OLAP query performance well beyond the classic volcano model on modern hardware.

2021052401

Vectorized calculation model

The classic volcano model passes one row at a time between operators. The vectorized calculation model passes data in batches instead, so each operator pulls multiple rows in a single call. Data within each batch can be stored in either column-major or row-major order.

This batch-oriented approach reduces per-row function call overhead.

2021052402

JIT compilation

The execution engine uses LLVM (Low Level Virtual Machine) to compile hot code paths at runtime. Rather than interpreting expressions through multiple layers of abstraction, the engine emits optimized machine code for expression evaluation and complex logical operations. The result is a smaller instruction footprint and execution speeds several times faster for compute-intensive workloads.

2021052403

Memory management

AnalyticDB for PostgreSQL optimizes memory management for hybrid transaction/analytical processing (HTAP) workloads using three strategies:

  • Memory reuse: Each operator stores its output in a block of row or column memory. Operators reuse this memory rather than allocating and releasing buffers for every operation.

  • Batch memory allocation: The engine estimates the memory each operator needs and allocates it upfront for the entire batch. This minimizes fragmented memory allocation.

    2021052404

  • Minimum memory principle: The engine avoids unnecessary memory requests, resets, and releases, keeping memory pressure low and throughput high.