Function  Operator  Example 

hll_add 
 
hll_add(users, hll_hash_integer(123)) or users  hll_hash_integer(123) or hll_hash_integer(123)  users

hll_cardinality 
# 
hll_cardinality(users) or #users

hll_union 
 
hll_union(male_users, female_users) or male_users  female_users or female_users  male_users

Function  Input  Example 

hll_hash_boolean 
boolean 
hll_hash_boolean(TRUE) or hll_hash_boolean(TRUE, 123/*hash seed*/)

hll_hash_smallint 
smallint 
hll_hash_smallint(4) or hll_hash_smallint(4, 123/*hash seed*/)

hll_hash_integer 
integer 
hll_hash_integer(21474836) or hll_hash_integer(21474836, 123/*hash seed*/)

hll_hash_bigint 
bigint 
hll_hash_bigint(223372036854775808) or hll_hash_bigint(223372036854775808, 123/*hash seed*/)

hll_hash_bytea 
bytea 
hll_hash_bytea(E'\\xDEADBEEF') or hll_hash_bytea(E'\\xDEADBEEF', 123/*hash seed*/)

hll_hash_text 
text 
hll_hash_text('foobar') or hll_hash_text('foobar', 123/*hash seed*/)

hll_hash_any 
any 
hll_hash_any(anyval) or hll_hash_any(anyval, 123/*hash seed*/)

logm2  regwidth=1  regwidth=2  regwidth=3  regwidth=4  regwidth=5  regwidth=6 

10  7.4e+02 _{128B}  3.0e+03 _{256B}  4.7e+04 _{384B}  1.2e+07 _{512B}  7.9e+11 _{640B}  3.4e+21 _{768B} 
11  1.5e+03 _{256B}  5.9e+03 _{512B}  9.5e+04 _{768B}  2.4e+07 _{1.0KB}  1.6e+12 _{1.2KB}  6.8e+21 _{1.5KB} 
12  3.0e+03 _{512B}  1.2e+04 _{1.0KB}  1.9e+05 _{1.5KB}  4.8e+07 _{2.0KB}  3.2e+12 _{2.5KB}  1.4e+22 _{3KB} 
13  5.9e+03 _{1.0KB}  2.4e+04 _{2.0KB}  3.8e+05 _{3KB}  9.7e+07 _{4KB}  6.3e+12 _{5KB}  2.7e+22 _{6KB} 
14  1.2e+04 _{2.0KB}  4.7e+04 _{4KB}  7.6e+05 _{6KB}  1.9e+08 _{8KB}  1.3e+13 _{10KB}  5.4e+22 _{12KB} 
15  2.4e+04 _{4KB}  9.5e+04 _{8KB}  1.5e+06 _{12KB}  3.9e+08 _{16KB}  2.5e+13 _{20KB}  1.1e+23 _{24KB} 
16  4.7e+04 _{8KB}  1.9e+05 _{16KB}  3.0e+06 _{24KB}  7.7e+08 _{32KB}  5.1e+13 _{40KB}  2.2e+23 _{48KB} 
17  9.5e+04 _{16KB}  3.8e+05 _{32KB}  6.0e+06 _{48KB}  1.5e+09 _{64KB}  1.0e+14 _{80KB}  4.4e+23 _{96KB} 
expthresh value  Meaning 

1  Promote at whatever cutoff makes sense for optimal memory usage. ('auto' mode) 
0  Skip EXPLICIT representation in hierarchy. 
118  Promote at 2^{expthresh  1} cardinality 