当前位置:网站首页>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';
边栏推荐
- 个人对卷积神经网络的理解
- 关于服装ERP,你想知道的都在这里了
- 小程序 修改样式 ( placeholder、checkbox的样式)
- Introduction to Resampling
- C final review
- Isprs2022/ cloud detection: cloud detection with boundary nets
- 企业级数据安全,天翼云是这样理解的
- Pytorch yolov5 training custom data
- Interprocess communication (IPC): shared memory
- Use QT to traverse JSON documents and search sub objects
猜你喜欢

企业级数据安全,天翼云是这样理解的
![2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]](/img/c9/f4ab4578029cf043155a5811a64489.png)
2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]

MySQL数据库索引教程(超详细)

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

Record eval() and no in pytoch_ grad()

Memory leak of viewpager + recyclerview

Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition

Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接

Thoroughly understand why network i/o is blocked?

Summary of six points of MySQL optimization
随机推荐
Lombok @builder annotation
Is it safe to open an account and register stocks for stock speculation? Is there any risk? Is it reliable?
企业数字化转型之路,从这里开始
How to obtain the coordinates of the aircraft passing through both ends of the radar
AI金榜题名时,MLPerf榜单的份量究竟有多重?
C language makes it easy to add, delete, modify and check the linked list "suggested collection"
项目中遇到的问题 u-parse 组件渲染问题
技术分享 | 常见接口协议解析
LeetCode 6111. 螺旋矩阵 IV
2022年5月腾讯云开发者社区视频月度榜单公布
Deep copy and shallow copy [interview question 3]
The main thread anr exception is caused by too many binder development threads
Common time complexity
Use QT to traverse JSON documents and search sub objects
输油管的布置数学建模matlab,输油管布置的数学模型
关于服装ERP,你想知道的都在这里了
Reptile 01 basic principles of reptile
Electron installation problems
图扑软件数字孪生智慧风电系统
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目