For the most cases I mentioned, we don't request a strict gapless sequence for the Invoice ID, the essential requirement is unique.
We just hope that there is no obviously gap in most situations.
From the test of UPSERT, there are quite a few chances to generate a big gap when UPSERT multi records.
However, the result of UPSERT is acceptable, and I do love this function. So, it's a suggestion only.
Anyway, thanks a lot for the detail explanation.
Regards,
Daojing Zhou.