Laravel Tech Community
Jul 5, 2020 · Databases
Understanding Auto‑Increment Gaps with REPLACE INTO and INSERT … ON DUPLICATE KEY UPDATE in MySQL
This article examines why MySQL auto‑increment primary keys can jump unexpectedly when using REPLACE INTO or INSERT … ON DUPLICATE KEY UPDATE, explains the role of innodb_autoinc_lock_mode, demonstrates examples, and offers practical solutions to prevent uncontrolled ID growth.
INSERT ON DUPLICATE KEY UPDATEMySQLReplace Into
0 likes · 11 min read