title: Large MyISAM table slow even for non-concurrent inserts/updates
body: <p>I have a MyISAM table with ~50'000'000 records (tasks for web crawler):</p>
  
  <pre><code>CREATE TABLE `tasks2` (
      `id` int(11) NOT NULL auto_increment,
      `url` varchar(760) character set latin1 NOT NULL,
      `state` varchar(10) collate utf8_bin default NULL,
      `links_depth` int(11) NOT NULL,
      `sites_depth` int(11) NOT NULL,
      `error_text` text character set latin1,
      `parent` int(11) default NULL,
      `seed` int(11) NOT NULL,
      `random` int(11) NOT NULL default '0',
      PRIMARY KEY  (`id`),
      UNIQUE KEY `URL_UNIQUE` (`url`),
          KEY `next_random_task` (`state`,`random`)
  ) ENGINE=MyISAM AUTO_INCREMENT=61211954 DEFAULT CHARSET=utf8 COLLATE=utf8_bin
  </code></pre>
  
  <p>Once every few seconds one of the following operations occur (but never simultaneously):</p>
  
  <ol>
  <li>INSERT ... VALUES (500 rows) - inserts new tasks</li>
  <li>UPDATE ... WHERE id IN (up to 10 ids) - updates state for batch of tasks</li>
  <li>SELECT ... WHERE (by next_random_task index) - loads batch of tasks for processing</li>
  </ol>
  
  <p>My problem is that inserts and updates are very slow - running on the order of tens of seconds, sometimes over a minute. Selects are fast, though. Why could this happen and how to improve performance?</p>