3 ms·
Semi-related in the land of Postgres and probabilistic data structures -- Redshift supports APPROXIMATE COUNT. Much, much faster than a raw COUNT, and their sta
by matsur 11y ago
Semi-related in the land of Postgres and probabilistic data structures -- Redshift supports APPROXIMATE COUNT. Much, much faster than a raw COUNT, and their stated error is +-2%
http://docs.aws.amazon.com/redshift/latest/dg/r_COUNT.html http://docs.aws.amazon.com/redshift/latest/dg/r_COUNT.html
- striking 11y agoI'd eat my hat if it didn't use a Bloom filter in some way.
- usman-m 11y agoIt probably uses a HyperLogLog--the 2% error rate kind of gives it away. Bloom filters approximate set membership queries, HyperLogLogs approximate set cardinality queries. COUNT DISTINCT is a set cardinality query. We actually support a HyperLogLog backed COUNT DISTINCT aggregate too: http://docs.pipelinedb.com/aggregates.html#general-aggregates http://docs.pipelinedb.com/aggregates.html#general-aggregate...
- striking 11y agoConsider my metaphorical hat eaten. Thanks for the cool tools! I'm currently working with Postgres and this looks like a great thing to add to the mix.
- anarazel 11y agoThere's a postgres extension that implements hll for postgres. Rather useful: https://github.com/aggregateknowledge/postgresql-hll https://github.com/aggregateknowledge/postgresql-hll