Assuming your gaps are in the ID
field of your table, you don't need to worry about the holes at all. The ID
column should be completely meaningless, and used purely to tie the values from the other columns together. It's quite common to have gaps in the ID values, and doesn't impact your table at all (aside from aesthetics).
For example, you have a third column there that is equal to your ID
. I assume that is the actual data you care about (such as a player tag). When running a SELECT
for this player, you would run your query based off of that column. A player with a player_id
of 2
can have an id
of 1
- that's totally fine!
For example, if you wanted to return this player, you would run:
SELECT * FROM players WHERE player_id = 2;
Which might return:
ID | Name | player_id
-------------------------
1 | player | 2
The ID
of 1
in the above doesn't matter, because you already have all the data you care about. It's simply an index.
You say you're going to delete 3000
or so rows, and that's still completely fine even without an 'order' per se. Simply use a WHERE
clause to delete based off of one of the other columns in the table. This will cherry-pick out the target rows to delete (leaving further gaps).
Hope this helps!