当前位置:网站首页>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';
边栏推荐
- New words new words new words new words [2]
- EasyCVR授权到期页面无法登录,该如何解决?
- Exemple Quelle est la relation entre le taux d'échantillonnage, l'échantillon et la durée?
- sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
- The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
- max31865模块RTD测温注意事项
- MySQL优化六个点的总结
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- Is it safe for Apple mobile phone to speculate in stocks? Is it a fraud to get new debts?
- U-Net: Convolutional Networks for Biomedical Images Segmentation
猜你喜欢

IDEA配置npm启动

Memory leak of viewpager + recyclerview

ConvMAE(2022-05)

Ant group open source trusted privacy computing framework "argot": open and universal

Shang Silicon Valley Shang preferred project tutorial release

MySQL优化六个点的总结

Isprs2022/ cloud detection: cloud detection with boundary nets

技术分享 | 接口测试价值与体系

@Extension, @spi annotation principle

Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
随机推荐
Rse2020/ cloud detection: accurate cloud detection of high-resolution remote sensing images based on weak supervision and deep learning
Ant group open source trusted privacy computing framework "argot": open and universal
达梦数据库udf实现
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接
企业级数据安全,天翼云是这样理解的
A2L file parsing based on CAN bus (3)
What is text mining? "Suggested collection"
Overview of video self supervised learning
About Estimation with Cross-Validation
金太阳开户安全吗?万一免5开户能办理吗?
进程间通信(IPC):共享内存
7-1 linked list is also simple fina
rust统计文件中单词出现的次数
Memory leak of viewpager + recyclerview
什么是文本挖掘 ?「建议收藏」
[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
How to choose the most formal and safe external futures platform?
Vulnhub's darkhole_ two
FCN: Fully Convolutional Networks for Semantic Segmentation