AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
How to Sum Up 80 Million Numbers in a Database
We need to somehow represent that data on disk. And we're looking at two ways to do this. The first one is JSON representation and then the second one would be sort of binary encoding. So in our fictional example, that would take up 1.6 gigabyte. But also it's slow. Part of why it's slow is again because we have these memory allocations but also the whole parse interest takes time. In our example, this took 14 seconds to sum up those 80 million numbers.