当前位置:网站首页>Mysql database indexing tutorial (super detailed)
Mysql database indexing tutorial (super detailed)
2022-07-05 18:46:00 【InfoQ】
Index preliminary
shortcoming
Index structure

Experiment preparation ( The following experiments are VMware In the middle of )
1、 Create a new database
create database test default character set utf8;
2、 Create a new data table
CREATE TABLE testsql (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY comment ' Since the primary key ',
dept tinyint not null comment ' department id',
name varchar(30) comment ' User name ',
create_time datetime not null comment ' Registration time ',
last_login_time datetime comment ' Last login time '
) comment ' The test table ';
3、 Write data
insert into testsql values(1,1,'user_1', '2018-01-01 00:00:00', '2018-03-01 12:00:00');
4、 assignment
set @i=1;
5、 Make a table with multiple increase ( Otherwise, tens of millions of data can't be written in a year )
insert into testsql(dept, name, create_time, last_login_time)
select left(rand()*10,1) as dept, # Random generation 1~10 The integer of
concat('user_',@i:[email protected]+1), # Generate different... In sequence name
date_add(create_time,interval [email protected]*cast(rand()*100 as signed) SECOND), # Generate random registration time with time sequence
date_add(date_add(create_time,interval [email protected]*cast(rand()*100 as signed) SECOND), interval + cast(rand()*1000000 as signed) SECOND) # Generate a random last login time with a time sequence
from testsql;
6、 see
select count(*) from testsql;
show variables like "%_buffer%";
7、 experiment
select COUNT(*) from t where name='user_500000';
8、 Create index




9、 Experimental results
select COUNT(*) from t where name='user_500000';
边栏推荐
- Einstein sum einsum
- Copy the linked list with random pointer in the "Li Kou brush question plan"
- A2L file parsing based on CAN bus (3)
- MYSQL中 find_in_set() 函数用法详解
- 开户注册股票炒股安全吗?有没有风险的?靠谱吗?
- Solutions contents have differences only in line separators
- 常见时间复杂度
- U-Net: Convolutional Networks for Biomedical Images Segmentation
- max31865模块RTD测温注意事项
- 2022 latest Android interview written examination, an Android programmer's interview experience
猜你喜欢
AI open2022 | overview of recommendation systems based on heterogeneous information networks: concepts, methods, applications and resources
AI金榜题名时,MLPerf榜单的份量究竟有多重?
LeetCode 6109. Number of people who know the secret
Various pits of vs2017 QT
Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
5. 数据访问 - EntityFramework集成
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
Summary of six points of MySQL optimization
企业级数据安全,天翼云是这样理解的
一朵云开启智慧交通新未来
随机推荐
音视频包的pts,dts,duration的由来.
在通达信上做基金定投安全吗?
技术分享 | 常见接口协议解析
SAP feature description
ROS安装报错 sudo: rosdep:找不到命令
蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用
鱼和熊掌可以兼得!天翼云弹性裸金属一招鲜!
Is it safe to open an account and register stocks for stock speculation? Is there any risk? Is it reliable?
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
7-2 keep the linked list in order
怎么自动安装pythn三方库
基于can总线的A2L文件解析(3)
ROS installation error sudo: rosdep: command not found
The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
Reading notes of Clickhouse principle analysis and Application Practice (5)
输油管的布置数学建模matlab,输油管布置的数学模型
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
How to choose the most formal and safe external futures platform?
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备