Feature request : _approx_count_distinct


Aproximates the number of distinct keys in a view index using a variant of the HyperLogLog algorithm. This algorithm enables an efficient, parallelizable computation of cardinality using fixed memory resources. CouchDB has configured the underlying data structure to have a relative error of ~2%.

@matthew.groves , @graham.pople

See https://www.citusdata.com/blog/2017/12/27/real-time-analytics-dashboards-with-citus/

As couchbase has no HyperLogLog implementation , How we can have real-time analytics dashboards?

Reply please , from
Mar 13 no responses


Hi @socketman2016, sorry for the delay. You can emit the key whose distinct value you want and then use reduce _count. While querying you can use group_level till which you want the distinct value and count the number of rows returned.
You can check this forum post which is similar to this

@AnkitPrabhu , In my experience , view is a poor performance in creation , when I have heavy write load (for 10 min) , 100% of cpu is consuming for more than 40 min