Absolute DB delivers stock exchange-grade performance through parallel query, hardware-vectorised execution, JIT compilation, and a hybrid transactional-analytical dual-store engine — all without a single external library.
Absolute DB uses a cost-based query optimizer that evaluates multiple execution plans and selects the lowest-cost plan before executing any query. The optimizer estimates row counts, I/O cost, and CPU cost for each candidate plan using table statistics and index selectivity.
-- Inspect the chosen plan
EXPLAIN SELECT * FROM orders WHERE customer_id = 42;
-- With actual timing
EXPLAIN ANALYZE SELECT * FROM orders WHERE total > 1000;The optimizer's statistics are refreshed automatically after bulk writes and can be triggered manually:
ANALYZE orders; -- refresh statistics for one table
ANALYZE; -- refresh all tablesAbsolute DB's parallel query engine uses a work-stealing thread pool of up to 64 workers (Enterprise Edition). Parallel scan, parallel hash join, parallel aggregation, and N-way merge gather are all supported.
parallel_workers = 64 # max worker threads (Enterprise: 64, SME: 4)
parallel_min_rows = 10000 # minimum estimated rows to parallelise
parallel_cost_threshold = 1000 # planner cost threshold
max_parallel_degree = 16 # max workers for a single query
-- Force parallel scan
SET parallel_workers = 16;
EXPLAIN ANALYZE SELECT SUM(amount) FROM orders WHERE status = 'completed';
-- Parallel Seq Scan on orders (workers: 16)
-- Workers Launched: 16
-- -> Partial Aggregate (workers: 16)
-- Per-query hint
SELECT /*+ PARALLEL(orders 8) */ SUM(amount) FROM orders;
| Operation | Strategy | Edition |
|---|---|---|
| Parallel Scan | Split B+Tree leaves into N equal ranges | SME+ |
| Parallel Hash Join | Hash-partition both inputs into N buckets | SME+ |
| Parallel Aggregation | Per-worker partial; coordinator merges | SME+ |
| Parallel Sort (Gather Merge) | N-way tournament tree merge | SME+ |
| 64-core parallelism | Full 64-worker pool | Enterprise only |
All scan kernels, aggregations, and vector distance functions are implemented
with SIMD intrinsics. The runtime selects the best instruction set via CPUID
(x86) or getauxval(AT_HWCAP) (ARM) — with a scalar fallback for
every kernel, ensuring correctness everywhere.
| ISA | Width | Platform | Throughput (4M integers) |
|---|---|---|---|
| AVX-512 | 512-bit | Intel Ice Lake, Xeon | 5,966 M elem/sec |
| AVX2 | 256-bit | Intel Haswell+, AMD Zen 2+ | 2,300–4,400 M elem/sec |
| SSE4.2 | 128-bit | Intel Nehalem+ | ~1,200 M elem/sec |
| NEON | 128-bit | ARM Cortex-A, Apple M series | ~1,800 M elem/sec |
| SVE2 | Scalable | ARM Neoverse N2, Apple M4 | Auto-detected vector length |
| Scalar | 64-bit | Any C11 target | ~200 M elem/sec |
SIMD kernels are selected automatically at startup based on CPU capabilities. Operations accelerated include column scan filters, vector distance calculations (L2, cosine), aggregation, and string search. Processes 8 integers or 8 floats per cycle on AVX2, scaling up to 16 on AVX-512.
SIMD acceleration is active in all editions — no configuration required.
Absolute DB emits native machine code for WHERE clause predicates directly into an executable memory buffer. Compiled predicates are cached by hash-keyed plan cache.
jit_enabled = true # enable JIT compilation
jit_min_cost = 100 # minimum planner cost to JIT-compile
jit_inline_cost = 500 # cost threshold for inlining subexpressions
| Feature | Detail |
|---|---|
| Targets | x86-64 and ARM64 (AARCH64) |
| Supported predicates | LT, GT, EQ, GE, LE, NE on INTEGER, REAL, TEXT |
| Code generation | Native machine code for comparison predicates with automatic interpreter fallback |
| Plan cache | hash-keyed, 1,024 entries, LRU eviction |
| Memory safety | Executable pages marked read-only after compilation; zeroed and unmapped on free |
| Fallback | Interpreter for unsupported expression types |
The HTAP engine maintains a row store and a columnar PAX store simultaneously, synchronised via a 4,096-entry lock-free zero-copy replication ring. The query planner automatically selects the optimal store per query — no ETL pipeline required.
-- Enable HTAP on a table
CREATE TABLE orders (
id BIGINT PRIMARY KEY,
customer_id BIGINT,
amount DECIMAL(12,2),
status TEXT,
created_at TIMESTAMP
) WITH (htap = true); -- both stores maintained automatically
-- Point lookup uses row store (O(1) B+Tree)
SELECT * FROM orders WHERE id = 99887766;
-- Analytical scan uses columnar PAX store (zone maps, SIMD)
SELECT status, SUM(amount) FROM orders GROUP BY status;
-- Replication lag
SELECT * FROM absdb_htap_repl_lag; -- typically < 5 ms
| Metric | Value |
|---|---|
| Replication ring size | 4,096 entries (lock-free) |
| Replication lag | ≤ 5 ms (typical LAN) |
| PAX stripe size | 65,536 rows per stripe |
| Max pages per stripe | 32 |
| Store selection | Planner cost-based (automatic) |
The query result cache caches complete result sets
for identical SQL text + bind parameters. Results are invalidated automatically
on INSERT, UPDATE, DELETE, or DDL on
any referenced table.
qcache_enabled = true
qcache_size_mb = 256 # total cache memory
qcache_max_result = 1048576 # max result size cached (bytes, default 1 MB)
qcache_ttl = 60 # maximum result age (seconds, 0 = no TTL)
-- Per-query cache control
SELECT /*+ CACHE(ttl=300) */ COUNT(*) FROM products WHERE category = 'electronics';
SELECT /*+ NO_CACHE */ * FROM live_prices WHERE symbol = 'AAPL';
-- Cache statistics
SELECT * FROM absdb_qcache_stats;
-- hits | misses | evictions | size_mb | hit_ratio
-- 4821 | 312 | 88 | 41 | 93.9%
The plan cache stores compiled query plans
for PREPAREd statements. Cached plans reduce SQL path latency
from ~85 µs to ~2 µs for warm queries. Plans are invalidated
automatically on DDL changes to referenced tables.
-- Prepare a statement (plan compiled + cached)
PREPARE get_order(BIGINT) AS
SELECT id, amount, status FROM orders WHERE id = $1;
-- Execute (uses cached plan, ~2 µs)
EXECUTE get_order(99887766);
-- Deallocate
DEALLOCATE get_order;
-- View cache
SELECT * FROM absdb_plan_cache;
-- name | uses | avg_time_us | created_at
-- get_order | 18422 | 1.9 | 2026-04-05 09:00:00
| Parameter | Value |
|---|---|
| Hash function | hash-keyed plan cache |
| Cache size | 1,024 plans |
| Eviction policy | LRU |
| Invalidation trigger | Any DDL on referenced table |
| Warm latency | ~2 µs (vs ~85 µs cold) |
PAX (Partition Attributes aXis) columnar pages store all values for a column contiguously within a 64 KB page. Zone maps (per-column min/max in the page header) allow entire pages to be skipped without reading a single data byte.
-- Create a columnar table (analytics workload)
CREATE TABLE events (
ts TIMESTAMP,
user_id BIGINT,
event TEXT,
value REAL
) WITH (storage = columnar, page_size = 65536);
-- EXPLAIN shows zone-map predicate pushdown
EXPLAIN SELECT COUNT(*) FROM events WHERE ts > '2026-01-01';
-- PAX Columnar Scan on events
-- Zone Map Filter: (ts > '2026-01-01')
-- Pages skipped by zone map: 14,832 / 15,000 (98.9%)
| Encoding | Best For | Ratio |
|---|---|---|
| RLE (Run-Length Encoding) | Low-cardinality columns (status, category) | Up to 1000:1 |
| Bit-packing | Small integers, booleans | 2–64:1 |
| Dictionary | Repeated strings (up to 256 distinct values) | 4–32:1 |
The Gorilla compression algorithm uses XOR delta encoding for floating-point time-series values, achieving up to 10:1 compression on typical sensor and metrics data.
-- Enable Gorilla compression on a hypertable
CREATE TABLE metrics (
ts TIMESTAMP NOT NULL,
sensor TEXT,
value REAL
) WITH (
hypertable = true,
chunk_interval = '1 hour',
compression = gorilla
);
-- Compression statistics
SELECT * FROM absdb_compression_stats WHERE table_name = 'metrics';
-- rows | compressed_bytes | raw_bytes | ratio
-- 10M | 24 MB | 240 MB | 10:1
Advisory locks provide application-level cooperative locking compatible with Flyway, Liquibase, Alembic, and golang-migrate. Up to 65,536 concurrent advisory locks are supported.
-- Session-scoped exclusive lock
SELECT pg_advisory_lock(42);
-- ... critical section ...
SELECT pg_advisory_unlock(42);
-- Transaction-scoped (auto-released on COMMIT/ROLLBACK)
BEGIN;
SELECT pg_advisory_xact_lock(42);
-- ... work ...
COMMIT;
-- Non-blocking try
SELECT pg_advisory_try_lock(42); -- returns true/false
-- Shared lock (multiple readers)
SELECT pg_advisory_lock_shared(42);
SELECT pg_advisory_unlock_shared(42);
The LISTEN/NOTIFY implementation is
compatible with the PostgreSQL wire protocol NotificationResponse
('A' message). Any PostgreSQL client library that uses LISTEN/NOTIFY works
unchanged — Rails ActionCable, Django Channels, and every PG real-time app.
-- Publisher
NOTIFY order_events, '{"order_id": 99887766, "status": "paid"}';
-- Subscriber (in a separate session)
LISTEN order_events;
-- Asynchronous notification received:
-- channel=order_events payload={"order_id":99887766,"status":"paid"}
-- pid=14421
UNLISTEN order_events; -- unsubscribe
| Limit | Value |
|---|---|
| Maximum payload size | 8,000 bytes |
| Per-session notification queue | 256 entries |
| Fan-out | All sessions subscribed to channel |
| Wire protocol | PostgreSQL NotificationResponse ('A') |
The binary COPY format is compatible with the PostgreSQL binary COPY protocol, enabling bulk loads at up to 3× the speed of CSV COPY by eliminating text parsing overhead.
-- Binary bulk import (3x faster than CSV)
COPY orders FROM '/tmp/orders.bin' WITH (FORMAT binary);
-- Binary export
COPY orders TO '/tmp/orders.bin' WITH (FORMAT binary);
-- COPY from STDIN (PostgreSQL wire compatible)
COPY orders (id, customer_id, amount, status) FROM STDIN WITH (FORMAT binary);
-- CSV still supported
COPY orders FROM '/tmp/orders.csv' WITH (FORMAT csv, HEADER true, DELIMITER ',');
~154 KB binary · zero external dependencies · 2,737 tests passing · SQL:2023 100%