3 ms·
Yes, that's correct, that's actually the obvious way to write it. I think the logic behind putting it in the index was to be able to check the transaction times
by eloff 6y ago
Yes, that's correct, that's actually the obvious way to write it. I think the logic behind putting it in the index was to be able to check the transaction timestamp without the extra indirection and cache miss, and to have that information there if the data is on disk, and there is no record loaded in memory. Not having the indirection was a big deal for the cache eviction algorithm which sampled many records and then evicted the coldest %, weighted for frequency of access and size.
There are other ways of doing that though, I'm not sure the trade off was the best one in the end.
- CyberDildonics 6y agoRight, so it isn't about lots of algorithms being prevented, it is actually a pretty reasonable constraint and not a huge deal. If you were worried about cache and indirection, the indices could be aligned to the start of a 64 byte or 128 byte boundary, since 64 bytes is the cache line size but (Intel) cpus will load two cache lines at a time. Because of this, loading in your 64 bit/8 byte index should mean that the 120 bytes after it are going to be cached.