0

Geohash has precision levels ranging from 1 and 12 (e.g., 2p5qnb2). The longer a precision level, the smaller the size the Geohash covers.

What will be the total memory needed to store all Geohash strings?

For each Geohash character, it could be made up of 0 - 9 digit or 22 lowercase alphabets (all alphabets except "a", "i", "l" and "o"). This makes each character can be fit with 5 bits (2 ^ 5 = 32 possibilities from digits and lowercase alphabets), but let's assume 1 byte for each character for simplicity.

Below is my calculation:

  1. For precision level of length 12, we will need 12 bytes each, and we will have 32 ^ 12 of Geohash strings.
  2. Similarly, for precision level of length 12, we will have 32 ^ 11 of Geohash strings.
  3. And so on.

So we will have 32 ^ 12 + 32 ^ 11 + 32 ^ 10 ... + 32 = ~ 1.19 x 10 ^ 18 bytes = 1,190 PBs, which seems way off to me.

240h32g
  • 1
  • 2
  • What about it seems off? Storing every possible combination of anything is almost always exponential or factorial, and both functions grow extremely quickly. – AspectOfTheNoob Jan 09 '23 at 00:13
  • Do we use every combination of Geohash strings in practice? – 240h32g Jan 09 '23 at 00:58
  • Maybe. But how does that translate to storing every possible Geohash string? I looked it up, and it seems to use an algorithm to translate positions into hashes. – AspectOfTheNoob Jan 09 '23 at 01:04

0 Answers0