When the sequence number is highlighted, it remains highlighted, even if the TX that requested it is rolled back. In this way, a number that is not displayed in a stable database can be allocated. Of course, rows can also be deleted after they are created, so the maximum number found in the table does not have to be the maximum number ever allocated. This applies to any type of auto-increment.
In addition, depending on the technology used, individual sequences can be used with several tables, so the value may not be in table A, but present in TableB. This may be due to a mistake in using sequence names or it may be intentional.
Jonathan leffler
source share