I have a 100 million rows, and it\'s getting too big. I see a lot of gaps. (since I delete, add, delete, add.)
I want to fill these gaps with auto-increment. If I do
Does it really matter if there are gaps?
If you really want to go back and fill them, you can always turn off auto increment, and manually scan for the next available id every time you want to insert a row -- remembering to lock the table to avoid race conditions, of course. But it's a lot of work to do for not much gain.
Do you really need a surrogate key anyway? Depending on the data (you haven't mentioned a schema) you can probably find a natural key.