WL#1333: Speed up ALTER TABLE (part 3: Rebuild unique indexes by sorting in ALTER TABLE)Affects: Server-7.1 — Status: On-Hold — Priority: MediumCurrently in MyISAM tables non-unique indexes are rebuilt by sorting on ALTER TABLE (OPTIMIZE TABLE etc) which is fast, unlike it UNIQUE (and PRIMARY) keys are rebuilt by key_cache which is very slow on large table sizes especially if keys are comming in random order - the IO becomes random and so one is able to insert just some hundred index values per second on commodity hardware. We shall be able to use rebuilding by sort for unique indexes as well (using modified filesort which alerts on dublicates) at least for the cases when we do not need to find error as early as possible. One way to do it is to use UNIQUE_CHECKS variable (now it is for InnoDB only) - make foreign-key support possible for any storage engine (which could handle it) via a combination of API calls and server handling. This is one that I need to watch for progress. Look forward to reading an update on this topic. Pat. Also, "alter table add index" rewrites the entire table, including all other indexes on the table. Can this be avoided as part of this work? |
VotesWatches11 members are watching this worklog
You must be logged in to track this worklog.
Provide Feedback
You must be logged in to comment
|
I use the abbreviation FK when discussing the child / referencing table (the table with the foreign key), or its indexes and columns. I use the abbreviation PK when discussing the parent / referenced table (which is often a table with a primary key), or its indexes and columns.
marketing diploma AND Bachelor degrees AND bachelor degree business