kingres_sketch
kingres · Mergeable HyperLogLog, Space-Saving and t-digest aggregates.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102355 | kingres_sketch | kingres | 1.0 | OLAP | AGPL-3.0-only | C |
PostgreSQL · 18, 19
Usage
Sources:
kingres_sketch 1.0 supplies mergeable HyperLogLog distinct counts, Space-Saving frequent-item summaries and t-digest percentiles. Its fixed schema avoids conflicts with other sketch extensions. The reviewed source targets PostgreSQL 18/19 and needs no preload or restart.
Build and combine sketches
Types and error bounds
Types kingres_sketch.hll, kingres_sketch.topn and kingres_sketch.tdigest can be stored and merged. hll_add_agg/hll_union_agg, topn_add_agg/topn_union_agg and the t-digest aggregate family support partial aggregation. Use schema-qualified names or add the extension schema after the application schema in the search path.
HLL precision is 4–18; sketches must have matching precision to merge, or first use hll_fold to reduce precision. Top-N capacity is 1–100000 and merge capacities must match; topn_list reports frequency estimates and error bounds. T-digest compression is 10–10000. These are approximate summaries, not exact counts or guaranteed percentiles. Sketches have no comparison operators/default operator classes and cannot directly be grouping or index keys. Distributed pushdown across shard groups is outside this release.