PostgreSQL extension for HyperLogLog cardinality estimation
PostgreSQL extension adding HyperLogLog data structures as a native data type
psql$ psql -d mydb -c 'CREATE EXTENSION hll;'$ psql -d mydb -c 'CREATE TABLE events (id SERIAL, hll_sketch hll);'$ psql -d mydb -c "INSERT INTO events (hll_sketch) VALUES (hll_add_agg(hll_hash_integer(user_id))) FROM users; SELECT hll_cardinality(hll_sketch) FROM events;"