Default index_cache_size causes very slow alter table ... add index
Bug #309510 reported by
Andrew Garner
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBXT |
Fix Committed
|
Medium
|
Paul McCullagh |
Bug Description
Using the default index_cache_size (32M) against a relatively small (~200M) table, adding an index taking >43 minutes on my hardware. Watching disk io from the otherwise idle MySQL process shows several gigs of data written (at 130+M/s), while the entire database is only ~350M. Through some automated trial-and-error, I found that raising index_cache_size to 128M, while still leaving all other parameters at their defaults allows this process to complete in <2 minutes.
For reference, I used the 'test-db' database for testing from http://
USE employees;
SET SQL_LOG_BIN = 0;
ALTER TABLE salaries ADD INDEX date_range_idx (from_date, to_date);
Related branches
To post a comment you must log in.
Thanks for the report. Running the ALTER with default memory parameters is very slow indeed