I need to add a column to a table which consists of 3 million rows, 400MB data and 600MB index file. I tried it on my - powerful enough - development box with several MySQL configurations and the ALTER TABLE took about 23 minutes. Most of the time goes on copying the data file, NOT on recreating indexes: 18 against 5 minutes. Is this the best I can expect?
I find it strange that copying 400MB data takes 18 minutes. It is not a fair comparison, but simply copying that file takes 12 seconds. Moreover the whole thing could comfortably fit in memory.
Indeed, I think the task is CPU bound, although processor usage stays at about 50% (on both cores). During the copying of the data file Windows Task Manager doesn't show too many IOs and I don't hear the hard disk either.
The machine is a dual core AMD 3800, 2G RAM, 10000RPM SATA HD. An example MySQL 5.0.37 configuration:
myisam_sort_buffer_size=256M
key_buffer_size=256M (MySQL Admin shows only half of it is used)
read_buffer_size=2M (increasing it doesn't help)
read_rnd_buffer_size=8M (increasing it doesn't help)
sort_buffer_size=2M (increasing it doesn't help)
I find it strange that copying 400MB data takes 18 minutes. It is not a fair comparison, but simply copying that file takes 12 seconds. Moreover the whole thing could comfortably fit in memory.
Indeed, I think the task is CPU bound, although processor usage stays at about 50% (on both cores). During the copying of the data file Windows Task Manager doesn't show too many IOs and I don't hear the hard disk either.
The machine is a dual core AMD 3800, 2G RAM, 10000RPM SATA HD. An example MySQL 5.0.37 configuration:
myisam_sort_buffer_size=256M
key_buffer_size=256M (MySQL Admin shows only half of it is used)
read_buffer_size=2M (increasing it doesn't help)
read_rnd_buffer_size=8M (increasing it doesn't help)
sort_buffer_size=2M (increasing it doesn't help)
Comment