I started doing this:
But it stopped with "ERROR 1206 (HY000): The total number of locks exceeds the lock table size", which I don't have the time to look into right now.
But I'm not so sure that these deletes are correct after all. New orphan data is still being added to the history tables. So I guess my (our) idea of orphan data isn't wholly correct. A comment from the developers would be nice.
Code:
DELETE history_str FROM history_str LEFT JOIN items ON history_str.itemid=items.itemid WHERE items.itemid IS NULL; DELETE history_uint FROM history_uint LEFT JOIN items ON history_uint.itemid=items.itemid WHERE items.itemid IS NULL; DELETE history_log FROM history_log LEFT JOIN items ON history_log.itemid=items.itemid WHERE items.itemid IS NULL; DELETE history FROM history LEFT JOIN items ON history.itemid=items.itemid WHERE items.itemid IS NULL;
But I'm not so sure that these deletes are correct after all. New orphan data is still being added to the history tables. So I guess my (our) idea of orphan data isn't wholly correct. A comment from the developers would be nice.

Comment