Skip to content

pg_yaap

YAAP optimizer + executor integration prototype

pg_yaap · YAAP optimizer + executor integration prototype

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101652pg_yaappg_yaap1.0OLAPApache-2.0C++

PostgreSQL · 18

Usage

Sources:

pg_yaap uses its own analytical optimizer and C++17 vectorized executor over native PostgreSQL Heap storage. Release 0.0.3 retains control/SQL version 1.0 and supports PostgreSQL 18.x (18.3 tested). This is experimental software.

Enable for a Session

After the matching library is installed, an authorized administrator can load it for the current session. CREATE EXTENSION pg_yaap also runs LOAD during installation, but does not persist hooks into future sessions. Optional shared preload enables all sessions and requires a server restart.

LOAD 'pg_yaap';
SET pg_yaap.enabled = on;
SET pg_yaap.parallel_max_workers = 4;
EXPLAIN SELECT region, count(*) FROM sales GROUP BY region;
SELECT region, count(*) FROM sales GROUP BY region;
SET pg_yaap.enabled = off;

The example assumes an existing persistent sales table. TEMP buffers are invisible to its workers. Plain EXPLAIN shows YAAP admission; EXPLAIN ANALYZE is unsupported. Once a query is admitted, execution errors are raised rather than silently retried through PostgreSQL’s executor.

Resources and Limits

Defaults are pg_yaap.enabled=on, pg_yaap.parallel_max_workers=4 and pg_yaap.memory_limit=256MB. The memory limit bounds shared pipeline-breaker payloads, not whole-process RSS or PostgreSQL shared buffers. Worker capacity and spill disk still need independent sizing.

DML and special cursor modes are unsupported. Numeric execution uses scaled values bounded by 128 bits, not arbitrary precision, and does not support numeric NaN or Infinity. Verify types, semantics and results on representative queries before admission. Matching LLVM components may be needed by the installed build; no table-format conversion or separate storage engine is required.

Upstream 0.0.3

Release0.0.3 improves heap execution and supports NAMEOID scans/filters. Its release artifacts target Ubuntu24.04 with PostgreSQL18 on x86_64 and aarch64. SQL version remains1.0; session loading and the experimental admission/error boundaries above still apply.

Upstream 0.0.4: Optional LLVM Provider

Release 0.0.4 separates the optional yaap_llvmjit tuple-deformation provider from the core library. The core can run without LLVM using the Generic deformer. Install a provider built for the same server if LLVM deformation is needed, then inspect SHOW yaap.jit and SELECT yaap_jit_available(). This is not a new SQL extension identity or table format; the pg_yaap control version remains 1.0. Use fresh sessions after replacing the library, or restart if it was shared-preloaded.

Table reader