Optimizing Database Algorithms for Random-Access Block Devices