7 ms·
If you are satisfied with an approximation of "DISTINCT", there is a facinating probabilistic algorithm by Flajolet and Martin https://en.wikipedia.org/wiki/Fl
by muth02446 1mo ago
If you are satisfied with an approximation of "DISTINCT", there is a facinating
probabilistic algorithm by Flajolet and Martin
https://en.wikipedia.org/wiki/Flajolet%E2%80%93Martin_algorithm https://en.wikipedia.org/wiki/Flajolet%E2%80%93Martin_algori...
which fits on 10 lines and does not require sorting.
Improved versions of it are LogLog and HyperLogLog.
- esafak 1mo agoAPPROX_COUNT_DISTINCT / APPROX_DISTINCT https://www.sketchingbigdata.org/ https://www.sketchingbigdata.org/