What should be the correct value for innodb-flush-log-at-trx-commit if I want to make the query faster at any cost?
I do not bother about data integrity at this moment. I have set the following in my.cnf
innodb_flush_method=O_DIRECT
innodb-flush-log-at-trx-commit = 2
Is it correct?
innodb-flush-log-at-trx-commit = 0 is slightly faster than 2, but less durable. If you are just reimporting data = 0 is fine, but the savings are not (usually) high enough to toleration the added losses.
If you want to disable a bunch of features for speed here they are:
Not that I don’t recommend any of this. Please be careful with this advice, it is not for production.