当前位置:网站首页>Throwing a question? The execution speed of the Count operation in the Mysql environment is very slow. You need to manually add an index to the primary key---MySql optimization 001
Throwing a question? The execution speed of the Count operation in the Mysql environment is very slow. You need to manually add an index to the primary key---MySql optimization 001
2022-08-09 09:59:00 【cool brain】
Find a table in the project, select count(1) is very, very slow in about 10 seconds, the solution:
Add unique so on the primary key of the table, and then perform the select count operation, you can find that this time becomes 0.28 seconds
The speed is very fast, but it is very strange why the speed is slow, because the primary key is generally indexed by default, why do you need it
It's weird to manually re-index.
I don't understand...hey..what's going on...experts tell me..
边栏推荐
- Redis 缓存主动更新策略
- Ontology Development Diary 03-Understanding Code
- What is the reason for the suspended animation of the migration tool in the GBase database?
- LeetCode56:合并区间 C语言解法,注解详细 一看就懂!
- 图表示学习(Graph Representation Learning)笔记
- MySQL索引、视图、设计三范式,通俗易懂,不可错过!
- 写一个通讯录小程序
- 7.FileFilter interface
- Thread,Runnable,ExecutorService线程池控制下线程量
- Openwrt配置Aria2(Hg255d)
猜你喜欢
Ontology development diary 04 - to try to understand some aspects of protege
BigDecimal用法常用操作记录
Ontology development diary 02 - simple sparql query
在anaconda环境中配置cuda和cudnn
蓄电池建模、分析与优化(Matlab代码实现)
搭建Tigase进行二次开发
拿下跨界C1轮投资,本土Tier 1高阶智能驾驶系统迅速“出圈”
latex中复杂公式换行等号对齐
Cisco common basic configuration of common commands
Quick sort eight sorts (3) 】 【 (dynamic figure deduction Hoare, digging holes, front and rear pointer method)
随机推荐
写一个通讯录小程序
Go-goroutine 的那些事
8.Properties property collection
MySQL关于表的知识点,进来学习!
文件操作
Celebrate ranked 18
markdown转ipynb--利用包notedown
常用的一些制表符号
BlockingQueue理论普
Apache Log4j 2 远程代码执行漏洞详解
4.泛型和工具类
缓存击穿,缓存穿透,缓存雪崩的解释和对应的一些解决方案
2. Byte stream
6.File类
条件控制语句
技术分享 | 如何模拟真实使用场景?mock 技术来帮你
LeetCode56:合并区间 C语言解法,注解详细 一看就懂!
cannot import name ‘load_offloaded_weights‘ from ‘accelerate.utils‘ (/home/huhao/anaconda3/envs/huha
Sweet alert
4. Generics and Utilities