- MySQL 8 for Big Data
- Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
- 241字
- 2021-08-20 10:06:04
InnoDB auto increment
MySQL 8 has changed the auto-increment counter value store mechanism. Previously, it was stored in the memory, which was quite difficult to manage during server restarts or server crashes. However, now the auto-increment counter value is written into the redo log whenever the value gets changed and, on each checkpoint, it will be saved in the system table, which makes it persistent across the server restart.
With the previous version, updating the auto-increment value may have caused duplicate entry errors. Suppose if you updated the value of auto-increment in the middle of the sequence with a larger than the current maximum value, then but subsequent insert operations could not identify the unused values, which could cause a duplicate entry issue. This has been prevented by persisting the auto-increment value, hence subsequent insert operations can get the new value and allocate it properly.
If server restart happened, the auto-increment value was lost with the previous version as it was stored in memory and InnoDB needed to execute a query to find out the maximum used value. This has been changed, as the newer version has the capability to persist its value across the server restart. During the server restart, InnoDB initializes the counter value in memory using the maximum value stored in the data dictionary table. In case of server crashes, InnoDB initializes the auto-increment counter value that is bigger than the data dictionary table and the redo log.
- GraphQL學(xué)習(xí)指南
- Visual FoxPro程序設(shè)計教程
- Hands-On Enterprise Automation with Python.
- RSpec Essentials
- Kubernetes進階實戰(zhàn)
- HTML+CSS+JavaScript網(wǎng)頁制作:從入門到精通(第4版)
- Python Projects for Kids
- Java EE 8 and Angular
- Learning Shiny
- 分布式系統(tǒng)架構(gòu)與開發(fā):技術(shù)原理與面試題解析
- Azure for Architects
- INSTANT Apache Maven Starter
- ACE技術(shù)內(nèi)幕:深入解析ACE架構(gòu)設(shè)計與實現(xiàn)原理
- 代碼揭秘
- 青少年編程魔法課堂:Python圖形化創(chuàng)意編程