Does a DELETE statement on an InnoDB table in MySQL cause the table to be physically reordered? I have a huge (200 million) row table that I want to delete certain records from. When I delete from it based on a WHERE condition it takes something like 90 minutes but only affects a few hundred thousand rows.
According to this stackoverflow answer, that's because deleting rows causes the table to be physically reordered on the disk: How can I improve DELETE FROM performance on large InnoDB tables?
I used the solution they provided and it worked: Make a new table and insert only the rows you want to keep, then drop the original. BUT! The DBA ran the same straight DELETE on a copy of the database and it worked in 5 minutes. Even with caching I'm surprised.
I can't find any documentation from Oracle or otherwise proving the physical reordering is happening. Does anyone know where I can find documentation stating this is the case? Or some way to prove if this is the cause?