How Innodb flushes data to the disk ?

In my previous post I was a bit wrong giving Innodb some properties it does not have.
In fact Innodb does not currently sort pages in their position order flushing them to disk. Pages to be flushed are instead identified by other means – LRU and pages which contain oldest LSN (so which were flushed longest time ago).

As pages are to be flushed are identified Innodb looks at pages pages N-1 and N+1 and if they are dirty schedules flush for these as well. Such approach allows to merge few pages together and perform flushes in larger blocks.

It is really interesting to see how much sorting would speed things up, ie how much flushing pages 1 10000 200 20000 300 30000 in order 1, 200, 300, 10000, 20000, 30000 will help compared to random order and if it is worth to bother or if optimization Innodb performs is good enough and IO subsystem and RAID can do the rest.

Share this post

Comments (3)

  • Kevin Burton Reply

    I just always assumed it did that…… Ug.

    The checkpointing in innodb needs some serious work. More on that later.

    July 18, 2007 at 10:06 am
  • Espresso Junkie Reply

    We always wondered about this. Thx for pointing this out!

    July 20, 2007 at 12:42 am

Leave a Reply