4 ms·
Rows are generally written to disk in the order they're inserted, whether you have a timestamp or not. It's just how database IO works. If your index happens t
by perrygeo 4y ago
Rows are generally written to disk in the order they're inserted, whether you have a timestamp or not. It's just how database IO works.
If your index happens to be in a different order (the position in the index is uncorrelated to the position of the row), you're gonna be thrashing pages. This isn't unique to UUID keys - text keys or anything other than current timestamp or serial id are going to have the same problem.
It's really only an issue once your index size exceeds available shared RAM. If you can fit your table's index completely in memory, you probably won't notice. But once you exceed that threshold, performance starts falling off a cliff.