Describe your problem. For example, paste the relevant code and error information. paste the relevant information. Which methods have been tried? Still not solved? (attach the relevant link)
Describe your problem
Example
Paste related Code
Post error message
Labeling
Methods that have been tried are still not resolved (attached with the relevant link)
Reply content:
Describe your problem
Example
Paste related Code
Post error message
Labeling
Methods that have been tried are still not resolved (attached with the relevant link)
Auto-increment id, if it is also transactional, will easily lead to blocking. Therefore, it is designed because if the business needs to be continuous, You can manually assign id through count and so on when inserting instead of auto-increment.
Why do IDs need to be continuous? uniqueness is king.
It clearly tells you that there is no way.
The primary key of mysql is maintained in the memory. Once a fault occurs, it cannot be repaired. Why must it be continuous? Jie Li?
If you really want to keep IDs consecutively, you can roll back the discarded ID and save it for the next time.
However, I think the IDS also represent the time sequence of database insertion to a certain extent. After reuse, the order is messy...