# citusdata/postgresql-hll

PostgreSQL extension adding HyperLogLog data structures as a native data type

Repository: https://github.com/citusdata/postgresql-hll
Canonical: https://ross.abutalabs.com/products/postgresql-hll
Homepage: http://blog.aggregateknowledge.com/2013/02/04/open-source-release-postgresql-hll/
Language: C
License: Apache-2.0
License Family: permissive
Last push: 2026-06-02T09:04:51+00:00

## Health v2 (maintenance only)
Score: 83/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 85, release rhythm 72, longevity 100
- inputs: {"age_days": 4958, "days_push": 92, "days_rel": 30, "gap_med": 144.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1228, forks 115 (observed 2026-08-28T04:04:03.431220+00:00)

## What it is
A PostgreSQL extension that adds HyperLogLog as a native data type for approximate distinct value counting with tunable precision. It uses a hierarchy of algorithms (EMPTY, EXPLICIT, SPARSE, FULL) to improve accuracy and memory efficiency over the original HLL paper.

## Use cases
- count distinct values in postgres with low memory
- estimate unique visitors per day in sql
- compute approximate cardinality of billions of values
- run fast distinct count aggregations in analytics queries
- store probabilistic sets as a postgres column type
- merge hll sketches across distributed postgres nodes

## When to choose
- you need approximate distinct counts at massive scale with tiny fixed memory footprint
- you want to aggregate and merge cardinality sketches directly in SQL
- you need tunable precision trading accuracy for storage in Postgres

## When to avoid
- you need exact distinct counts rather than estimates
- you are not using PostgreSQL or a compatible database
- your cardinalities are small enough that plain COUNT(DISTINCT) is fast enough

## Facets
- artifact type: library
- maturity: stable
- function: database, data-science, analytics
- domain: databases, analytics, big-data
- platform: self-hosted
- tags: postgresql-extension, hyperloglog, sketching, distinct-count, probabilistic-data-structures, approximate-counting, linux, macos, docker

## Member repositories
- citusdata/postgresql-hll (main) score 83

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:03.431220+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:15:10.130333+00:00, confidence not recorded.
  - readme: https://github.com/citusdata/postgresql-hll (fetched 2026-08-28T04:04:03.431220+00:00, sha 9bf8b47aa526)
- Data as of 2026-08-30T08:39:29.467469+00:00.
