Skip to content

Hardware-Aware Semantic Types

Specialised TypesAnalytics
Beta Works · surface still evolving · surface still evolving; not yet listed in the core type reference

Generic numeric and string types are the lingua franca of relational databases, but they leave performance on the table. A timestamp plus a value doesn’t tell the engine “this is a trending series”; an array of tags doesn’t say “this is a small categorical set”; a pair of coordinates doesn’t say “these things are spatially close.”

AetheriusDB ships a small family of semantic primitives that encode that analytical intent directly. Each one answers a specific analytical question without unpacking, sorting, or auxiliary indexes. Use them where they fit; stick to plain types where they don’t.

These types collapse common analytical patterns from slow window-and-index queries into straight column scans, because the question each type answers is built into how it stores its values. Use the right type for the right workload and queries that used to need indexes, window functions, or auxiliary tables become simple column scans.

  • Trend detection without windows — a flux type carries its own delta, so “is this rising?” is a direct check.
  • Tag containment without arrays — an enum-set type makes WHERE tags CONTAINS 'X' AND 'Y' a single bitwise operation across millions of rows.
  • Spatial proximity without R-trees — a geo-hex type turns a radius query into an integer range scan.
  • Distributed primary keys without coordination — an identity type combines a timestamp, a node ID, and a sequence into collision-free monotonic IDs across a cluster.
  • Cardinality without hash maps — an approximate distinct count over billions of values resolves with ~99% accuracy and a few kilobytes of memory.

Declare semantic columns in CREATE TABLE just like any other type. The queries that benefit are the obvious ones for each: trend checks for flux, containment for enum sets, radius for geo, monotonic inserts for identity, distinct counts for probabilistic.

-- A flux column carries a value plus its momentum.
CREATE TABLE ticks (
symbol TEXT,
price FLUX(10, 2),
ts TIMESTAMP
);
-- "Currently rising?" is a single check — no LAG() needed.
SELECT symbol
FROM ticks
WHERE FLUX_RISING(price);
-- An enum-set column packs up to 256 tags into one value;
-- identity gives a distributed-safe primary key; geohex stores location.
CREATE TABLE documents (
id IDENTITY,
tags ENUMSET,
region GEOHEX
);
-- Tag containment is one bitwise operation.
SELECT id
FROM documents
WHERE ENUMSET_CONTAINS_ALL(tags, 'Urgent', 'Finance');
-- Geo proximity is an integer range scan — no R-tree, no Haversine.
SELECT id
FROM documents
WHERE GEOHEX_WITHIN_KM(region, 37.77, -122.41, 25);
-- Approximate distinct count over billions of rows in a few KB of RAM.
SELECT APPROX_COUNT_DISTINCT(user_id)
FROM page_views;

Each of these queries would be a multi-step plan with auxiliary indexes on a generic-types-only database. Here they’re one column scan.

TypeUse it for
FLUXFixed-point value with an embedded momentum delta. Tickers, sensors.
ENUMSETA bitmask covering up to 256 categorical values. Tags.
GEOHEXA hexagonal tessellation index. Spatial proximity, fleet tracking.
IDENTITYA primary key combining timestamp, node, and sequence — collision-free across a cluster.
ProbabilisticA column for ~99% accurate distinct counts at trivial memory cost.