当前位置:网站首页>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';
边栏推荐
- EasyCVR授权到期页面无法登录,该如何解决?
- Quickly generate IPA package
- Trust counts the number of occurrences of words in the file
- Solutions contents have differences only in line separators
- 2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
- 2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]
- The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
- How to obtain the coordinates of the aircraft passing through both ends of the radar
- 2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
- 2022 latest Android interview written examination, an Android programmer's interview experience
猜你喜欢

深入底层C源码讲透Redis核心设计原理

企业数字化转型之路,从这里开始

Reading notes of Clickhouse principle analysis and Application Practice (5)

Oracle 中文排序 Oracle 中文字段排序
![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]

蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用

LeetCode 6111. Spiral matrix IV

LeetCode 6111. 螺旋矩阵 IV

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

ConvMAE(2022-05)
随机推荐
Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app
LeetCode 6109. Number of people who know the secret
Pytorch yolov5 training custom data
ViewPager + RecyclerView的内存泄漏
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
C language makes it easy to add, delete, modify and check the linked list "suggested collection"
Introduction to Resampling
AI金榜题名时,MLPerf榜单的份量究竟有多重?
Find in MySQL_ in_ Detailed explanation of set() function usage
Clickhouse (03) how to install and deploy Clickhouse
Various pits of vs2017 QT
Ant group open source trusted privacy computing framework "argot": open and universal
企业数字化转型之路,从这里开始
图扑软件数字孪生智慧风电系统
Reading notes of Clickhouse principle analysis and Application Practice (5)
开户注册挖财安全吗?有没有风险的?靠谱吗?
IDEA配置npm启动
Cronab log: how to record the output of my cron script
Use JMeter to record scripts and debug
关于服装ERP,你想知道的都在这里了