Let’s say when you have to run a batch process monthly, you can survive with times like 10 minutes. I can imagine a lot of seasoned DBAs right now ROFL about my insignificant 10 minutes. The point here is I was developing this process and some test cases, so my usual trial/error methodology doesn’t scale very well with 10 minute offsets.
So I borrowed an idea from a colleague:
why not moving all the database to memory? It’s not so big and I
have 2G of ram. But, could I change all tables (~20) to
MEMORY in one line or so?
Since this was a Ruby on Rails project, I used the rails console to be able to mix SQL and Ruby. My first try:
conn.tables.each do |t|
conn.execute "ALTER TABLE #{t} ENGINE=MEMORY"
end
First error: foreign …
[Read more]