Hacker News new | ask | show | jobs
by dataflow 265 days ago
Is it just me or can you describe the whole scheme in one sentence?

tl;dr: subdivide your hash space (say, [0, 2^64)) by the number of slots, then utilize the index of the slot your hash falls in.

Or, in another sense: rely on / rather than % for distribution.

Is this accurate or am I missing something?

2 comments

You're missing that the hash space is not divided uniformly. Which means one can vary the number of slots without recomputing the hash space division -- and without reassigning all of the existing entries.
I must've totally misunderstood what I read then. I'll give it another read, thanks!
That's the naive method which tends to redistribute most objects when the number of slots changes.