当前位置:网站首页>mysql-三星索引和cost值成本计算
mysql-三星索引和cost值成本计算
2022-04-21 13:47:00 【bingtanghulu_6】
1. 三星索引概念
三星索引 的概念比较绕口,我自己理解整理了一下:
1. B+树上相邻的记录尽量放在一起
2. 索引中的数据顺序和查找中的排列顺序一致,也就是order by和group by的字段尽量跟索引顺序一致。
3. 尽量覆盖索引,避免回表。

2. 索引的几个优化建议
1. 只为搜索,order by,group by查询列创建索引;
2. 尽量使用三星索引;
3. 主键列不要update,最好使用insert;
4. 不要在冗余和重复列上创建索引。计算公式参考上一篇博客。
5. 未使用的索引删除
3. mysql-cost值成本计算
计算cost值之前先说一下I/0时间和CPU时间
I/0时间=寻道时间+旋转时间+传输时间(一次I/0时间大概在9-10ms左右),其中寻道时间最长,因为他是一个机械运动,旋转时间很快,平常咱们的电脑的转数一般都是几千或者1万多,传输时间都是ns级,忽略不计。最浪费时间的就是寻道时
版权声明
本文为[bingtanghulu_6]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_21575929/article/details/122312915
边栏推荐
猜你喜欢

海口等保测评公司有几家?具体在哪里?哪里可以查到?

Improving the efficiency of randomly generated sphere interference inspection by block division

【leetcode】516.最长回文子序列

Dynamic implementation of address book

實現隨機標簽,字體大小、顏色隨機顯示

SQLyog导入sql文件

通讯录的动态实现

Ipemotion collects J1939 protocol signal

JDBC 和数据库连接池

International logistics centralized transportation system source code, overseas warehousing cross-border transshipment system source code
随机推荐
Hystrix使用
STM32驱动ST7789V2 tft屏幕
Machine learning notes - Moore Penrose pseudo inverse
JVM字节码文件结构深度剖析
定位子元素的结构伪类
The data show how fierce eth burns
Forced to choose an outsourcing company
Work function of boost ASIO
EsgynDB SQL统计模式下各对象个数
Ali Tianchi competition -- street view character coding recognition
Route selection, anti ring and re release of hcip OSPF
CV technical guide free knowledge planet
Longest ascending subsequence (2) (greedy + dichotomy)
Idea automatically generates unit test classes
Do self media and short videos, and don't trust those mutual relations and mutual praise
Peking University ACM problems 1010: stamps
字符串中字符排序 (10 分)请编写函数fun对长度为8个字符的字符串按降序排列。
Réaliser l'affichage aléatoire de l'étiquette, de la taille de la police et de la couleur
npm---package.json
Filter string only retains the alphabetic characters in the string (10 points). Please write a function fun. The function is to enter a string, filter the string, only retain the alphabetic characters