10. Oct 2020 |

MySQL autoincrement PK growing quickly

Primary key (PK) is skipping values for some reason. This was an issue I spent time solving until I discovered that auto increment column increases after insertion error occurs. To avoid duplicates on this website I set rule on MySQL side that if three colums match then don’t insert (give insertion error and continue). This way I had hundreds of insertion errors every hour and therefore PK was growing rapidly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.