# PostgreSQL HyperLogLog

DevFeed: [PostgreSQL HyperLogLog](<https://devfeed.tech/articles/postgresql-hyperloglog-34496.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2013/02/postgresql-hyperloglog/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2013-02-25T09:23:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Statistics](<https://devfeed.tech/topics/statistics.md>), [Extension](<https://devfeed.tech/topics/extension.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [bug](<https://devfeed.tech/tags/bug.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [extension](<https://devfeed.tech/tags/extension.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [statistics](<https://devfeed.tech/tags/statistics.md>)

## AI overview

This tutorial explains how to use the postgresql-hll extension with PostgreSQL for HyperLogLog cardinality estimation. It covers installation, estimating unique values such as IP addresses, handling concurrency with queued asynchronous updates, and protecting against empty-set and NULL behavior. The article also discusses a possible aggregate bug.

## Source excerpt

If you've been following along at home the newer statistics developments, you might have heard about this new State of The Art Cardinality Estimation Algorithm called HyperLogLog. This technique is now available for PostgreSQL in the extension postgresql-hll available at https://github.com/aggregateknowledge/postgresql-hll and soon to be in debian.