MySQL Forums
Forum List  »  MyISAM

Re: random reads
Posted by: Rick James
Date: February 06, 2009 09:53PM

You answered it yourself. Imagine a room full of filing cabinets. In them are folders for people. Task one (range scan) is to go through them in alphabetical order. Pretty easy, pretty fast.

Task 2 is that you have a list of people, but they are not in alphabetical order. Yet you have to look up their folders in the order on the list. Get the picture?

InnoDB would have to do the same thing. One difference is that InnoDB tends to be 2x-3x more bulky, so less can be cached.

Avg of 1ms/row sounds reasonable for effectively sequential reads.

For random reads, I would expect typically one disk hit per row. And unless you are reading from floppies or slow USB dongle, that should take around 10ms/row, not 800.

key_buffer_size (for MyISAM) should be about 20% of available RAM. If it is too small, you will also be thrashing disk over the index blocks (which are cached in the key_buffer).

My mantra: "Count the disk hits".

Options: ReplyQuote


Subject
Views
Written By
Posted
5785
February 05, 2009 05:32PM
Re: random reads
2808
February 06, 2009 09:53PM
2836
February 10, 2009 06:10PM
2658
February 14, 2009 12:50AM
2482
February 23, 2009 11:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.