Is it impractical to just use an autoincrementing column (as you suggest) to give the children an explicit ordering, but then “number” them by their derived index rather than the concrete value of that column?