1

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?

thomasrutter
  • 114,488
  • 30
  • 148
  • 167

2 Answers2

0

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.

thomasrutter
  • 114,488
  • 30
  • 148
  • 167
-1

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

Michael Mior
  • 28,107
  • 9
  • 89
  • 113
  • 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 02:39
  • Sorry, I should have noticed that you're using InnoDB. – Michael Mior Jul 23 '11 at 03:44