mysql max(自增主键)很快
来源:互联网 发布:晋中网络教研平台首页 编辑:程序博客网 时间:2024/05/22 05:30
“`
explain select max(id) from xx;
+——+————-+——-+——+—————+——+———+——+——+——————————+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+——+————-+——-+——+—————+——+———+——+——+——————————+
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
+——+————-+——-+——+—————+——+———+——+——+——————————+
在查看max的执行计划的时候,出现了select tables optimized away的这种方式,执行的速度奇快,下面是官网的描述,可以看到是直接在内部表读取的记录,不需要去扫描表。
For explains on simple count queries (i.e. explain select count(*) from people) the extra section will read “Select tables optimized away.” This is due to the fact that MySQL can read the result directly from the table internals and therefore does not need to perform the select.
但是不知道内部是怎么存放的,难道每个表存放一个自增主键的计数器?
- mysql max(自增主键)很快
- mysql主键自增
- mysql 主键自增
- mysql自增主键
- mysql 设置自增主键
- MySQL设置主键自增
- mybatis mysql 主键自增
- MySQL删除主键和添加自增主键
- mysql 修改主键自增,新增联合主键
- 令mysql数据库主键自增
- mysql 复制一条记录 自增主键
- mysql联合主键的自增问题
- MYSQL数据库自增主键的重要性
- mysql 自增主键重新排序
- mysql修改主键自增语句
- mysql AUTO_INCREMENT 设置主键自增
- mysql innodb 自增主键与innodb_autoinc_lock_mode
- mysql iot 主键自增列问题
- 剑指offer-丑数
- matlab 函数循环 每次只做一次,但是保留顺序
- 从0开始学习 GitHub 系列之「01.初识 GitHub」
- adb shell查看进程提示grep不是内部命令或外部命令解决办法
- 【struts2】中各个jar包作用
- mysql max(自增主键)很快
- TCMalloc的使用与源码剖析之八---------TCMalloc内存分配与释放的管理之内存泄露检查
- 实现一组功能的步骤及模板
- 2016京东算法工程师实习生笔试编程题:上台阶
- 用命令行编译链接c++
- 【java web】 错误debug记录与总结
- Windows下Redis安装(非集群)
- UDP协议(一)两台主机通讯
- 剑指offer-二叉树深度