I am running some unit and integration tests on my machine. In this testing environment, data integrity does not matter. I don’t care if data gets written to the discs, I just want my tests to be fast.
Is there any option I can enable so InnoDB operates completely in RAM?
Aside from changing the table types to MEMORY instead of InnoDB, you can make inserts and updates significantly faster by using the
innodb_flush_log_at_trx_commitsetting.A setting of 2 instead of one can easily make inserts and updates 10x faster or more. Effectively this causes InnoDB to fsync() data to the transaction log every second rather than at every transaction commit.
Another option would be to just use larger transactions (especially if you are inserting lots of data and using autocommit currently).