Batching in the Executor

Fletcher

25-Minute Talk

PostgreSQL’s executor still processes one tuple at a time -- a design inherited from the classic iterator model that favors modularity but adds significant per-tuple overhead on modern CPUs. Each tuple crosses multiple function call and branch boundaries, which limits instruction and cache efficiency even in simple scans.

Recent improvements -- opcode-based expression evaluation, scan inlining, and faster tuple deforming -- have reduced overhead in key paths, but the iterator model remains a bottleneck for analytic workloads. This talk presents a prototype that enables executor nodes to operate on batches of tuples instead of individual slots, reducing per-tuple costs while preserving PostgreSQL’s row-based semantics and plan structure.

The patch introduces an ExecProcNodeBatch() API and a TupleBatch abstraction for passing groups of tuples between nodes, along with table AM extensions for batch-mode scans. Expression evaluation is adapted to process batches in tight loops, paving the way for more efficient execution over large data sets.

The talk will describe the prototype design, early performance results, and outline possible next steps toward broader batch-aware execution in PostgreSQL.

Gold Sponsors

EDB

Microsoft

AWS

Huawei

Silver Sponsors

Percona

Fujitsu

HighGo

Duboce Labs, Inc.