Reduce amount of SQL-queries during reorder operation.