Seems like it would only be a win if you ensure low IDs are the popular ones. And then, consider a bitmap?
Login to reply
Replies (1)
the alternative is an array of 32 bit integers? There can be a large number of follows for every user you are building a follow index for. A follow list you want to be able to bsearch. I don’t see why this space savings wouldn’t add up.
Most will likely be 2 byte ints, i just don’t want to have to choose 4 bytes when most will be 2.
4 bytes * 1000 follows * 16000 users = 64 mb
vs
2 bytes * 1000 follows * 16000 users = 32 mb
i guess it comes down to if the complexity is worth it to save 32mb of storage 🤷♂️