Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Columnar / HTAP Tables

Source of truth: RFC-2026-092, RM-0.6.4.0 Sprint 3.

What Is HTAP row-column store

AngaraBase supports storing tables in the HTAP row-column format (HtapRowColumn): rows are written through the regular WAL, and columns are segmented in ColumnStore (SegmentManifest). This allows serving OLTP transactions and AP scans from one table.

Vector Pipeline (OLAP)

High-performance analytics (OLAP) uses the Vector Pipeline, which uses SIMD and parallel aggregation directly over columnar data.

Creating an HTAP Table (copy-paste ready)

There are two equivalent syntaxes:

-- Variant 1: PostgreSQL-style USING (recommended)
CREATE TABLE metrics (
    ts        TIMESTAMPTZ NOT NULL,
    device_id INT         NOT NULL,
    value     FLOAT8
) USING COLUMNAR;

-- Variant 2: WITH option (explicit alias)
CREATE TABLE events (
    id   SERIAL PRIMARY KEY,
    data TEXT
) WITH (storage = 'columnar');

-- Variant 3: canonical engine name
CREATE TABLE events2 (
    id   SERIAL PRIMARY KEY,
    data TEXT
) WITH (storage = 'htap_row_column');

All three forms are equivalent: the table is created with TableStorageEngineV0::HtapRowColumn in the catalog.

Checking engine in catalog

-- Through sys_catalog (RM-0.6.4.0)
SELECT table_name, storage_engine
FROM sys.tables
WHERE table_name = 'metrics';

Background Compaction (L1 Compaction)

Starting with RM-0.6.4.8, angarabase supports background compaction (L1 Compaction) for columnar tables. The compactor merges small L0 segments into larger L1 pack files, reducing inode pressure and improving compression. The process is fully transparent.

Metrics for monitoring compaction:

  • angarabase_columnar_compaction_total
  • angarabase_columnar_compaction_duration_ms
  • angarabase_columnar_direct_io_fallback_total

Errors and Their Meaning

Unknown USING method → 0A000

ERROR:  USING brin is not a supported storage method; ...
SQLSTATE: 0A000 (feature_not_supported)

What to do: use USING COLUMNAR, USING htap_row_column (→ HTAP), or omit USING (→ row_store by default).

Invalid storage value

ERROR:  storage expects one of: row_store, memory, columnar, htap_row_column
SQLSTATE: 42601 (syntax_error)

What to do: use one of the listed values.

Non-goals (Phase 1, RM-0.6.4.0)

  • SegmentManifest auto-init on table creation — deferred to Sprint 4 (OQ-S3-3).
  • OOM protection for Column Cache — Sprint 4 (OQ-S3-4).
  • Full AP scan optimization — RFC-2026-092 Phase 2.