This describes a naive implementation how to fix missing gaps after a reordering. Table tbl contains two columns. The position column is of type decimal to make the reordering easier.
CREATE TABLE tbl(key varchar(255), position decimal(5,4));
We fill the table with the following statements
INSERT INTO tbl values('A', 1.0);
INSERT INTO tbl values('B', 2.0);
INSERT INTO tbl values('C', 3.0);