Take the 2-minute tour ×

Is it possible to programmatically tell MySQL not to flush the log buffer immediately just for the current transaction, regardless of the innodb_flush_log_at_trx_commit setting?

Let's say you generally want ACID compliance so that your data is safe from any power/hardware faults. So you have innodb_flush_log_at_trx_commit = 1

But in your application, you have one particular INSERT query that needs to return quickly, and it's not as important for it to have the same level of integrity protection. Can you skip the flush (at the end of its transaction) just for that query/transaction? And can you do it programmatically, with an SQL query or something in PHP's PDO?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

I think the answer is that it can't be done - unless you are willing to switch to MyISAM just for the particular table in question.

share|improve this answer
If anybody knows better, please add your answer. I can change my accepted answer. –  thomasrutter Jul 25 '11 at 5:07
add comment

I'm not sure if this will do exactly what you want, but check out INSERT DELAYED.

share|improve this answer
Unfortunately InnoDB doesn't have INSERT DELAYED. I guess I have the option of using MyISAM for that one table, so thanks, but I was wanting to know if there was an InnoDB solution. –  thomasrutter Jul 22 '11 at 2:39
Sorry, I should have noticed that you're using InnoDB. –  Michael Mior Jul 23 '11 at 3:44
add comment

Your Answer


