Queue Implementation with Custom Consistent Absolute Ordering
(I'll compete with myself.  Here's an Answer for a &quot;large&quot; number of items.)
Updating 1K rows is not very fast, due to saving rows in case of rollback.  Incrementing/decrementing the sequence numbers (column seq) for a range of rows, then changing one the sequence in the one row that was moved.  That's 3 UPDATEs -- one slow, one fast.
The UI would need to provide some way for the user to specify which item to move from some seq to a new seq.
A column in the table would contain the sequence number.  seq would effectively be UNIQUE, but saying so might slow it down.
Suppose the UI tells the db that &quot;Seq=222 needs to move to after seq=567.  (after &quot;0&quot; for inserting at front.)
BEGIN;   -- need atomicity
-- Move item out of the way (assuming &quot;0&quot; is not otherwise used):
UPDATE t SET seq = 0 WHERE seq = 222;
-- Shift the items that need to move:
UPDATE t SET seq = seq - 1   -- &quot;-&quot; or &quot;+&quot; depending
    WHERE seq BETWEEN 222+1 AND 567;
-- move the item in question:
UPDATE t SET seq = 567 WHERE seq = 0;
COMMIT;

Moving the other direction needs a couple of changes.