INSERT INTO ... SELECT ... vs dumping/loading a file in MySQL
- by Daniel Huckstep
What are the implications of using a INSERT INTO foo ... SELECT FROM bar JOIN baz ... style insert statement versus using the same SELECT statement to dump (bar, baz) to a file, and then insert into foo by loading the file?
In my messing around, I haven't seen a huge difference. I would assume the former would use more memory, but the machine that this runs on has 8GB of RAM, and I never even see it go past half used.
Are there any huge (or long term) performance implications that I'm not seeing? Advantages/disadvantages of either?