当前位置:网站首页>mysql index
mysql index
2022-07-31 01:51:00 【my genius girlfriend】
Index: a sorted data, the index records the one-to-one correspondence between the position where the index is added and each row of records in the data in the data table.
An index is like a table of contents in a dictionary.
The way mysql traverses data:
Sequential traversal: the query will traverse the data in the database
Index traversal: find the appropriate index, and then locate the data of the corresponding row in the database according to the index, improving the data query ability
Indexing advantages and disadvantages:
Benefits
- All fields can be indexed
- You can add an index to one or more columns in the table
Disadvantages
- The index needs to occupy a certain position, and the data update also requires internal maintenance of the index within mysql
The principle of mysql index creation
- The smaller the data the better, the less memory it takes up
- Simple data types are best
- Try not to create indexes on null values, null values will make index calculation more difficult
mysql data index adds an index to the primary key or foreign key in the data. There is a certain amount of data in the table. This field is mostly used for data retrieval conditions, and this field is used for grouping and sorting.
Type of index
Unique, fulltext, spatial
Index Creation
alter table tableName add index indexName(columnName)边栏推荐
- tkinter模块高级操作(二)—— 界面切换效果、立体阴影字效果及gif动图的实现
- Simple confession page
- leetcode-399: division evaluation
- pycharm重命名后无法运行(报错: can‘t open file......No such file or directory)
- 打印任务排序 js od华为
- MySql installation and configuration super detailed tutorial and simple method of building database and table
- I have been working in software testing for 3 years, how did I go from just getting started to automated testing?
- 爬虫文本数据清洗
- vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验
- [Map and Set] LeetCode & Niu Ke exercise
猜你喜欢
随机推荐
Unity界面总体介绍
mmdetection训练一个模型相关命令
PDF split/merge
What have I experienced to become a tester who is harder than development?
MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法
mysql 索引
"Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
最高月薪20K?平均薪资近万...在华为子公司工作是什么体验?
加密生活,Web3 项目合伙人的一天
1.非类型模板参数 2.模板的特化 3.继承讲解
Jetpack Compose学习(8)——State及remeber
蛮力法/邻接表 广度优先 有向带权图 无向带权图
Drools基本介绍,入门案例,基本语法
leetcode-952: Calculate max component size by common factor
力扣刷题之爬楼梯(7/30)
VSCode Plugin: Nested Comments
Force buckled brush the stairs (7/30)
类似 MS Project 的项目管理工具有哪些
C language _ structure pointer array function voting system
android的webview缓存相关知识收集









