Papers
Topics
Authors
Recent
Search
2000 character limit reached

OmniSketch: Multi-Dimensional Stream Synopsis

Updated 13 May 2026
  • OmniSketch is a streaming synopsis data structure that efficiently summarizes multi-dimensional, high-velocity data streams for OLAP-style queries with arbitrary conjunctive predicates.
  • It combines Count-Min sketches with bottom-k minwise sampling to provide scalable, memory-efficient, and probabilistically accurate estimations while dynamically supporting filters on various attributes.
  • Extensions of OmniSketch enable join cardinality estimation, offering significant throughput improvements and controlled error profiles over prior approaches such as Hydra in high-dimensional settings.

OmniSketch is a streaming synopsis data structure capable of efficiently summarizing multi-dimensional, high-velocity data streams for OLAP-style analytic queries with arbitrary conjunctive predicates. It provides a scalable, memory-efficient, and probabilistically accurate count-aggregate estimation over streams with multiple attributes, dynamically supporting filters on arbitrary subsets of attributes selected at query time, and extends to enable join cardinality estimation across tables in relational systems (Punter et al., 2023, Justen et al., 25 Aug 2025).

1. Motivation and Limitations of Prior Synopses

OmniSketch addresses key limitations of traditional streaming synopses—particularly Count-Min (CM) sketch and related structures—which primarily support aggregate queries over a single attribute and are intractable for general multi-attribute predicate queries. Handling pp predicates over A|A| attributes in standard approaches would require 2p12^p-1 sketches or exponential per-update cost, which is prohibitive for even moderate values of pp (e.g., p10p \geq 10). These approaches are also incapable of efficiently supporting queries with “don’t-care” attributes without incurring exponential space or computational blowup (Punter et al., 2023).

2. Data Structure Overview, Initialization, and Update

OmniSketch consists of A|A| independent attribute sketches, each adopting a two-level structure:

  • An outer Count-Min sketch per attribute aia_i, comprising a d×wd \times w array of cells (dd: depth, ww: width).
  • Each cell A|A|0 maintains:
    • A counter A|A|1,
    • A minwise sample A|A|2 (“bottom-A|A|3” hash values of record IDs), and
    • The largest hash in the sample A|A|4.

During initialization, for user-supplied error (A|A|5) and confidence (A|A|6), parameters are set as:

  • A|A|7,
  • A|A|8,
  • A|A|9,
  • 2p12^p-10. Each cell’s sample has size 2p12^p-11.

For each new record arrival:

  • For each attribute, and each row 2p12^p-12:
    • Hash the attribute value to column 2p12^p-13, increment 2p12^p-14.
    • Hash record ID to 2p12^p-15, maintain the 2p12^p-16 smallest such hashes in 2p12^p-17 (using red-black tree structures for 2p12^p-18 updates).

This construction ensures per-record update cost is 2p12^p-19, and total memory pp0 (Punter et al., 2023).

3. Query Processing and Estimation Guarantees

To estimate the count of records matching a conjunction of pp1 arbitrary predicates, for example:

pp2,

OmniSketch:

  1. Identifies, for each predicate, the corresponding cells in the attribute CM sketches.
  2. Computes, over all involved cells, the maximum counter pp3.
  3. Intersects all corresponding bottom-pp4 samples to yield pp5 of size pp6.
  4. Returns estimator pp7.

This process leverages two main sources of accuracy:

  • Outer CM hashing bounds hash-collision false positives,
  • Inner K-minwise samples yield an unbiased estimate of intersection size.

Theoretical guarantees (with properly chosen pp8, pp9, p10p \geq 100) state that with probability at least p10p \geq 101:

p10p \geq 102

where p10p \geq 103 is the stream length. When the intersection sample p10p \geq 104 is too small, the estimator falls back to an upper bound with a controlled one-sided error (Punter et al., 2023).

4. Space, Time Complexity, and Parameterization

  • Space complexity: For p10p \geq 105 attributes, space is p10p \geq 106 bits; more succinctly p10p \geq 107.
  • Update cost: p10p \geq 108 per stream record.
  • Query cost: p10p \geq 109 worst-case per query, but typically lower due to early pruning in intersection.
  • Parameter selection: A|A|0, A|A|1, A|A|2 maximized given memory A|A|3. Increasing A|A|4 lowers sampling error, increasing A|A|5 mitigates collision error.

A quantitative trade-off is provided between memory, accuracy, and throughput. Empirical measurements confirm that, for up to A|A|6 attributes, ingest throughput remains over A|A|7 rec/s and accuracy is within the configured A|A|8 across several real and synthetic datasets (Punter et al., 2023).

5. Comparison with Existing Approaches

Hydra, the prior state-of-the-art for multi-attribute stream synopses, maintains a single CM sketch with “universal” summaries in each cell, necessitating A|A|9 update complexity per record. Experimentally, Hydra incurs both exponential update time (aia_i0 ms/update for aia_i1) and exponential hash-collision errors for larger aia_i2, rendering it impractical for high-velocity or high-dimensional streams.

OmniSketch achieves aia_i3 per-update complexity, comparable or superior accuracy, and update throughput two to three orders of magnitude higher for aia_i4. Error profiles remain stable under skew (e.g., Zipfian), and in range query settings, extension via a logarithmic number of dyadic CM sub-sketches yields range-count error at most aia_i5 with negligible query-time overhead (Punter et al., 2023).

6. Extensions: Join Cardinality Estimation

The OmniSketch framework has been extended to support join cardinality estimation for cost-based query optimization in relational databases (Justen et al., 25 Aug 2025). It merges count-min sketches and K-minwise hashing to estimate multi-way join sizes, without uniformity or independence assumptions.

Join Cardinality Algorithms

  • PK-Sample-Join: Samples primary-key side using OmniSketch, computes the inclusion probability aia_i6, and for each sample, probes the foreign-key side. The overall join estimate is aia_i7. This approach is sensitive to key-skew and composes poorly over multiple joins due to “witness loss.”
  • Secondary Sketches: Constructs secondary OmniSketches on dimension tables, reprojecting fact-side samples onto the secondary sketch’s sample space, which enables a join over multiple tables to reduce to a single intersection of sample sets. This allows efficient join-cardinality estimation, especially in star schemas.
  • Interoperability: All sketches use unified hash functions and root seeds, making probe and sample composition across tables possible.
  • Acyclic Join Graphs: An algorithm, based on GYO-ear-removal, sequences probe and intersection steps to guarantee witness flow and correctness in α-acyclic join structures.

Empirical Evaluation

  • On SSB-skew (star schema), secondary-sketch OmniSketch yields reductions of up to aia_i8 in intermediate result sizes and speedups up to aia_i9 in total execution times compared to DuckDB’s cost-based optimizer.
  • On JOB-light (general schema), performance is mixed due to high foreign-key cardinalities and complex join graphs causing frequent fallback events.
  • Core strength is in avoiding independence/uniformity assumptions, but performance degrades when compounded sampling probabilities become too small (Justen et al., 25 Aug 2025).

7. Practical Considerations and Future Directions

When deploying OmniSketch, practical parameter selection requires balancing memory constraints, target accuracy d×wd \times w0, and query throughput demands. Open challenges and extensions include:

  • Deletions/turnstile streams: Possible with two-level/bottom-d×wd \times w1 sketches; incurs modest update overhead.
  • Very high dimensionality d×wd \times w2: Potentially addressed via adaptive attribute selection or hierarchical sketching.
  • Skew adaptation: Detecting and reallocating buckets/samples for skewed attributes at runtime.
  • Range queries: Supported via dyadic decomposition, with logarithmic space/time overhead per attribute.

A plausible implication is that OmniSketch generalizes efficiently to high-dimensional, heterogeneous streaming and relational-analytic workloads with minimal modification, provided that attribute-range domains and sampling scales remain within practical sketch-memory budgets (Punter et al., 2023, Justen et al., 25 Aug 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to OmniSketch.