approx

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package approx provides approximate aggregate functions.

Provided functions:

  • approx_count_distinct(X, ...): approximate count of distinct elements using HyperLogLog.
  • approx_count_distinct_accumulate(X, ...): accumulates elements into a HyperLogLog sketch BLOB.
  • approx_count_distinct_combine(B): merges HyperLogLog sketch BLOBs into a single sketch BLOB.
  • approx_count_distinct_estimate(B): estimates the cardinality from a HyperLogLog sketch BLOB.
  • approx_percentile(X, P): approximate continuous quantile(s) P in [0, 1] using a REQ sketch.
  • approx_percent_rank(X, V): approximate relative rank(s) in [0, 1] of V using a REQ sketch.
  • approx_percentile_accumulate(X): accumulates elements into a REQ sketch BLOB.
  • approx_percentile_combine(B): merges REQ sketch BLOBs into a single sketch BLOB.
  • approx_percentile_estimate(B, P): estimates quantile(s) P in [0, 1] from a REQ sketch BLOB.
  • approx_percent_rank_estimate(B, V): estimates relative rank(s) in [0, 1] of V from a REQ sketch BLOB.

HyperLogLog sketch BLOBs use the Aggregate Knowledge HLL Storage Specification.

Relative Error Quantiles (REQ) sketches use high-rank accuracy mode, prioritizing precision at the upper tail (e.g. p95, p99, p99.9). Rank error matches typical KLL sketches at the median, and is at most 2x worse at the lower tail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(db *sqlite3.Conn) error

Register registers approximate aggregate functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL