当前位置:网站首页>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';
边栏推荐
- Is it complicated to open an account? Is online account opening safe?
- Reptile 01 basic principles of reptile
- 使用JMeter录制脚本并调试
- 2022 latest Android interview written examination, an Android programmer's interview experience
- 跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
- Overview of video self supervised learning
- 项目中遇到的问题 u-parse 组件渲染问题
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- 在通达信上做基金定投安全吗?
- Exemple Quelle est la relation entre le taux d'échantillonnage, l'échantillon et la durée?
猜你喜欢
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!
SAP feature description
Isprs2022/ cloud detection: cloud detection with boundary nets
Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接
使用JMeter录制脚本并调试
@Extension、@SPI注解原理
RedHat7.4配置yum软件仓库(RHEL7.4)
Overview of video self supervised learning
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
随机推荐
Reptile 01 basic principles of reptile
2022 latest Android interview written examination, an Android programmer's interview experience
What is text mining? "Suggested collection"
How much does the mlperf list weigh when AI is named?
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
[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
Personal understanding of convolutional neural network
MYSQL中 find_in_set() 函数用法详解
7-2 保持链表有序
SAP feature description
AI金榜题名时,MLPerf榜单的份量究竟有多重?
个人对卷积神经网络的理解
Record eval() and no in pytoch_ grad()
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
5. 数据访问 - EntityFramework集成
关于服装ERP,你想知道的都在这里了
ConvMAE(2022-05)
使用JMeter录制脚本并调试
Idea configuring NPM startup
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心