MySQL can use read_rnd_buffer to optimize data retrieval - As data is sorted by the key value it needs to be accessed in pretty much random row pointer (typically physical) order. MySQL takes bunch of pointers from sort_buffer (just enough so all rows fit in read_rnd_buffer as they are read) and sorts them by row pointer, when performs reading into read_rnd_buffer in the sorted order - it can be pretty much sequential if you’re lucky.
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.