--- Ludvig Strigeus <[EMAIL PROTECTED]> wrote:

> Quote:
> 
> InnoDB must flush the log to disk at each transaction commit, if that 
> transaction made modifications to the database. Since the rotation speed of 
> a disk is typically at most 167 revolutions/second, that constrains the 
> number of commits to the same 167/second if the disk does not fool the 
> operating system.
> 
> It looks like InnoDB only needs one cache flush per transaction, while 
> Sqlite needs two. Why is this the case? What does sqlite do differently? Can 
> the pager layer be modified to handle this differently?

A transaction commit in synchronous=NORMAL mode works more 
or less like this:

1. Write original data for modified database pages to journal file.
2. Sync journal file.
4. Write modified page data to database file.
5. Sync database file.
6. Delete journal file.

Step 6 actually commits the transaction.

If a process opens the database and finds it unlocked and there is a 
journal file, it is assumed a failure occured during transaction commit
and the original data from the journal file is copied back into the 
database file.

Anyone have a quick summary of InnoDB algorithm for comparison? I
suspect whatever trick they use won't work with SQLite because
there is no server process, but it could be interesting anyway.

Dan.



                
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

Reply via email to