I have a database with static tables which require to be updated from CSV weekly. Tables are Mysql MyISAM and by static i mean they are used for read only (except when updated from CVS, obviously).
There're about 50 tables and in total about 200mb of data to be reloaded weekly.
I can think about 3 ways:
- Truncate table
- Load data from files
Or
- For each table create a temporary table
- Load data there
- Truncate (or delete rows?) original table
- Insert into original table select * from temporary table.
Or
- Create table_new and load data there
- Rename original table to table_old (or drop table altogether)
- Rename table_new into original table
What do you reckon is the most efficient way?