SetrixDB Redefines High-Performance Data Filtering with Exact Set Arithmetic and AVX-512 Vectorization

Modern software architecture increasingly relies on operations that appear deceptively simple on the surface. Questions such as whether a specific identifier exists within a designated list, or which identifiers appear across multiple lists simultaneously, resemble classic computer science textbook exercises. However, when those lists expand to encompass millions or billions of individual elements and must deliver responses within microseconds—such as during faceted filtering, security permission evaluations, or candidate pre-filtering for large language models (LLMs)—the computational complexity escalates dramatically.
To address this performance bottleneck, developers and systems engineers have introduced specialized primitives designed to handle exact set operations over 64-bit unsigned integers (uint64 IDs). Unlike traditional databases or generic data structures that carry unnecessary memory overhead via pointers, indirections, and comparison operations, these arithmetic-driven engines treat the data itself as the number, reducing intersections to fundamental bitwise AND operations.
The Engineering Challenge: Set Algebra Over Identifiers
A substantial portion of contemporary backend processing involves cross-referencing collections of identifiers. Whether evaluating user permissions, executing e-commerce product filters, or processing retrieval-augmented generation pipelines for artificial intelligence, the underlying requirement remains constant: exact presence and exact intersection over IDs, entirely divorced from payload data.
While generic data structures like hash maps, relational database joins, and sorted scans successfully solve these logic problems, they fail to do so optimally. They expend valuable CPU cycles and memory bandwidth on pointer indirections that are entirely unnecessary when dealing strictly with numerical identifiers. By standardizing the format around uint64 IDs, developers can bypass traditional search overhead, turning complex relational lookups into streamlined arithmetic equations.
The Genesis of SetrixDB and the Minimal Perfect Hash Breakthrough
The development of high-performance set engines frequently encounters hidden pitfalls during the initial data ingestion phase. During the early architecture design of SetrixDB, engineers confronted a severe collision rate when utilizing a naive positional hash—a simple arithmetic formula intended to generate dense, collision-free identifiers from text strings. When tested against a corpus of 200,000 short alphanumeric tokens, the initial hashing mechanism produced a staggering 78 percent collision rate, resulting in disparate strings mapping to identical numeric identifiers.
To overcome this structural flaw, the engineering team implemented a Minimal Perfect Hash Function (MPHF), specifically utilizing the CHD v2 algorithm built entirely from scratch. This implementation guarantees zero collisions for a static set of keys, allowing for compact memory representation and predictable lookup times. Industry experts note that measuring collision rates against real-world data corpuses remains a critical step that is frequently overlooked, yet it fundamentally dictates the viability of low-level data structures.
Performance Benchmarks and Architectural Mechanics
Evaluated under standardized reference server conditions utilizing a 2 vCPU AMD EPYC processor featuring Zen4 architecture with AVX-512 support, 3.8 GB of RAM, and Go 1.22, the engine demonstrates distinct performance advantages over conventional methods.
When measuring membership queries across one million elements, standard Go hash maps (map[uint64]) consume approximately 22.3 bytes per key while achieving roughly 133.3 million operations per second with exact results. In contrast, SetrixDB utilizes its Minimal Perfect Hash Function structure to achieve an ultra-compact memory footprint of just 0.5 bytes per key for the structure, delivering deterministic lookups in approximately 118 nanoseconds. While probabilistic data structures like Bloom filters offer compact memory (1.2 bytes per key at a 1 percent false positive rate), their probabilistic nature renders them unsuitable for applications requiring absolute accuracy, such as security permission checks.
Intersection benchmarks comparing dense identifiers against random 64-bit IDs further illustrate the capabilities of vectorized execution. Utilizing AVX-512 bitset AND operations, intersection latencies plummet to as low as 6 microseconds for dense datasets, outperforming compressed bitmap libraries like Roaring and traditional hash joins by orders of magnitude.
Real-World Dataset Validation
To verify synthetic benchmarks against practical workloads, developers subjected the engine to rigorous testing across three distinct public datasets, with every result cross-verified independently using standard Unix utilities (sort and comm).
- Retail Sector: Utilizing the Online Retail II dataset from the UCI Machine Learning Repository, comprising over 1.06 million sales transactions from the United Kingdom between 2009 and 2011, queries filtering for transactions matching specific geographic, temporal, and pricing criteria returned precise record counts in under a millisecond, matching independent verification results identically.
- Text Processing: Testing against Wikipedia article titles totaling over 19.2 million terms, complex text-matching queries executed successfully in single-digit milliseconds, confirming the engine’s capability to manage large-scale string identifier indexing.
- Scale and Media: Processing the MovieLens 25M dataset, which contains over 25 million user ratings and derived categorical facets, demonstrated that dense bitsets combined with AVX-512 vectorization can achieve memory reductions of up to 43 times and speed improvements of up to 350 times compared to traditional sorted list merge operations.
Architectural Positioning: What It Is and What It Is Not
Industry analysts emphasize that specialized set engines are not designed to replace established relational, columnar, NoSQL, or vector databases. Rather, they are engineered to function as embeddable, symbiotic components that reside alongside primary data storage systems.
SetrixDB acts explicitly as an embeddable set engine that resolves exact presence and intersection constraints over numerical identifiers using SIMD kernels, sharding, and cluster distribution modes. It does not process SQL queries, perform complex relational joins, evaluate semantic vector similarities, or store payload data. Instead, it serves as an ultra-fast index and pre-filter layer, allowing existing databases to offload high-frequency set algebra operations.
Honest Limitations and Trade-Offs
Despite its performance advantages, architectural transparency requires acknowledging inherent limitations. Minimal Perfect Hash Functions are structurally designed for static or immutable datasets; mutable workloads involving frequent insertions and deletions require periodic index rebuilds or secondary sparse-mode fallbacks. Furthermore, the efficiency of dense bitsets relies heavily on a relatively dense universe of identifiers that can fit comfortably within system RAM. For highly sparse datasets or massive out-of-core workloads where memory constraints are paramount, alternative structures such as compressed Roaring bitmaps remain the optimal architectural choice.
Broader Industry Implications and Future Outlook
The introduction of specialized, arithmetic-driven set engines reflects a broader paradigm shift in systems engineering. As modern computing applications increasingly prioritize rapid decision-making over mere data storage capacity, developers are finding that general-purpose databases occasionally introduce unacceptable latency overhead on hot execution paths.
By treating identifier sets as pure arithmetic and leveraging modern hardware capabilities like AVX-512 vector instructions, engineering teams can achieve dramatic efficiency gains without overhauling their primary persistence layers. Released under the permissive Apache-2.0 open-source license, SetrixDB invites the global developer community to evaluate its benchmarks, test its operational limits, and explore the evolving boundary between hardware-accelerated computation and traditional database design.







