NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›
INDEXES

Indexes you declare, and one you do not.

Every column already has the filter index: fingerprints and zone bounds, maintained on write. Declare B-tree, hash or GIN indexes when you want to go straight to a key; the engine picks the method if you do not.

HOW IT WORKS · ANIMATED 12 s cycle

A SELECT, from predicate to answer

Rows are not found through a B-tree. Per-column fingerprints rule out most of the table 512 rows at a time, zone maps rule out whole ranges, and only the candidates left are read.

STATEMENT SELECT name FROM users WHERE city = 'Oslo' AND age > 30 city = 'Oslo'→ fingerprint planes age > 30→ zone min / max users · 512 ROW SLOTS · ONE SIMD REGISTER PER COLUMN PLANE zone 0age 18…64 zone 1age 19…30 zone 2age 21…71 zone 3age 18…29 SKIPPED SKIPPED ROWS FILE · FETCH 29 of 512 rows read VISIBILITY + EXACT CHECK xmin ≤ snap < xmax · city = 'Oslo' ANSWER ✓ 20 rows no false negatives, ever candidate (maybe) false positive / invisible version zone ruled out by min/max
  1. 1
    Predicates extracted

    WHERE city = 'Oslo' AND age > 30 is split into an equality the fingerprints can test and a range the zone maps can test.

  2. 2
    Zone maps skip ranges

    Each zone records min and max per column. Zones whose max age is 30 or less cannot match and are skipped whole.

  3. 3
    Fingerprints, 512 at a time

    Bit-sliced fingerprint planes for city are compared against 'Oslo' in SIMD: one register answers for 512 rows.

  4. 4
    Only candidates are read

    The candidate bitmap names the few rows worth fetching. The rest of the rows file is never touched.

  5. 5
    Visibility, then exact check

    A version this snapshot cannot see is dropped. A fingerprint can say maybe but never no to a match, so each candidate is checked exactly.

  6. 6
    The answer

    What survives is the answer: no false negatives, ever, and the false positives were cheap.

1 / 3

Declared indexes

With no USING, a column of UUIDs, documents or MAC addresses gets a hash index, since nobody asks a range of a random UUID; anything ordered gets a B-tree. A type that cannot be indexed by the requested method is refused with the reason, never indexed approximately.

SQL
CREATE INDEX orders_customer ON orders (customer_id);            -- method chosen
CREATE INDEX orders_placed ON orders USING btree (placed_at);
CREATE INDEX sessions_token ON sessions USING hash (token);
CREATE INDEX orders_cust_day ON orders (customer_id, placed_at);  -- composite
CREATE INDEX IF NOT EXISTS ON orders (status);                    -- name derived
2 / 3

Kept honest

  • An implicit index for every PRIMARY KEY, UNIQUE column and composite unique constraint
  • Persistent on disk, paged, resident in memory or behind a cache: your choice per server
  • rdb_index_check audits a table's indexes against its rows
  • On a partitioned table, CREATE INDEX applies to every partition
3 / 3

The filter index underneath

Unindexed columns still prune their scans: zone maps at 0.25 bits per row skip ranges, and bit-sliced fingerprints test 512 rows per SIMD register. Tune it per column, or turn it off where it does not pay.

SQL
SET FILTER max_f = 24 FOR COLUMN users.email;
SET FILTER indexed = off FOR TABLE audit_log;
✓ page rendered in 782 µs axum + tera + htmx · no other javascript