1

I am using a very simple implementation of redis HLL

PFADD to add the elements and PFCOUNT ( something with PFMERGE ) to get the count

Is there a way I can tune the efficiency of redis HLL , by increasing memory allocated etc

Ram
  • 1,155
  • 13
  • 34

1 Answers1

0

NO, you CANNOT. The size of a hyperloglog is hard coded, and you cannot change it by configuration or compile-time options. If you do need to change it, you have to modify the source code and build it by yourself.

// hyperloglog.c

#define HLL_P 14 /* The greater is P, the smaller the error. */

Also, the greater is P, the more memory it costs.

for_stack
  • 21,012
  • 4
  • 35
  • 48
  • I would anyway have very few HLL keys , So memory is not the problem Should I increase the HLL_P size then. What should I keep it as ? – Ram Sep 04 '21 at 07:11
  • I tried to recompile with HLL_P 28 ... but make test fails – Ram Sep 06 '21 at 07:46
  • Of course the test will fail, since you've changed the precision. You should also modify the test code if you want to pass the test. Or write your own test cases. – for_stack Sep 06 '21 at 08:48