| ▲ | debazel 4 hours ago | ||||||||||||||||
It doesn’t have anything to do with indexing more than one thing. The issue with truly random IDs is that inserts are scattered throughout the B-tree index, which cause page splits, fragmentation, and poor cache locality. Using a timestamp prefix makes new IDs sequential, so inserts tend to land near the end of the index, which avoid all the B-tree trashing and improve write performance. | |||||||||||||||||
| ▲ | saagarjha 3 hours ago | parent [-] | ||||||||||||||||
Yes, which means that you should probably be able to provide your timestamp to the database so it can use it for optimizing its index, rather than trying to shove it in your ID | |||||||||||||||||
| |||||||||||||||||