当前位置:网站首页>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)
边栏推荐
- 934. The Shortest Bridge
- 程序员转正述职报告/总结
- leetcode-128: longest continuous sequence
- Google官方控件ShapeableImageView使用
- I have been working in software testing for 3 years, how did I go from just getting started to automated testing?
- VSCode Plugin: Nested Comments
- 内网渗透——提权
- What are the project management tools like MS Project
- 《MySQL数据库进阶实战》读后感(SQL 小虚竹)
- 力扣刷题之爬楼梯(7/30)
猜你喜欢
最高月薪20K?平均薪资近万...在华为子公司工作是什么体验?
Set the browser scrollbar style
Are you still working hard on the limit of MySQL paging?
Word 表格跨页,仍然显示标题
[WeChat applet] This article takes you to understand data binding, event binding, event parameter transfer, and data synchronization
mmdetection训练一个模型相关命令
CV-Model [3]: MobileNet v2
进程间通信学习笔记
MySQL (6)
Overview of prometheus monitoring
随机推荐
如何在 go 程序中暴露 Prometheus 指标
MySQL的分页你还在使劲的limit?
vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验
Shell script to loop through values in log file to sum and calculate average, max and min
coldfusion8后台计划任务拿shell
leetcode-128: longest continuous sequence
Shell变量与赋值、变量运算、特殊变量
934. The Shortest Bridge
pycharm cannot run after renaming (error: can't open file...No such file or directory)
项目开发软件目录结构规范
软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具
multiplayer-hlap 包有问题,无法升级的解决方案
想要写出好的测试用例,先要学会测试设计
How to expose Prometheus metrics in go programs
曼城推出可检测情绪的智能围巾,把球迷给整迷惑了
pycharm重命名后无法运行(报错: can‘t open file......No such file or directory)
mysql 视图
验证整数输入
.NET 跨平台应用开发动手教程 |用 Uno Platform 构建一个 Kanban-style Todo App
Crawler text data cleaning