当前位置:网站首页>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)边栏推荐
- Are you still working hard on the limit of MySQL paging?
- "Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
- 力扣刷题之有效的正方形(每日一题7/29)
- 加密生活,Web3 项目合伙人的一天
- GCC Rust获批将被纳入主线代码库,或将于GCC 13中与大家见面
- Force buckled brush the stairs (7/30)
- Crypto Life, a day in the life of a Web3 project partner
- 蛮力法/邻接矩阵 广度优先 有向带权图 无向带权图
- 软件测试报告有哪些内容?
- uniapp uses 3rd party fonts
猜你喜欢

"Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition

软件测试报告有哪些内容?

rpm install postgresql12

pycharm cannot run after renaming (error: can't open file...No such file or directory)

leetcode-399: division evaluation

After reading "MySQL Database Advanced Practice" (SQL Xiao Xuzhu)

vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验

Google官方控件ShapeableImageView使用

手把手教你配置Jenkins自动化邮件通知

最大路径和
随机推荐
软件测试要达到一个什么水平才能找到一份9K的工作?
勾股数元组 od js
汉诺塔问题
pycharm cannot run after renaming (error: can't open file...No such file or directory)
软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具
The Meta Metaverse Division lost 2.8 billion in the second quarter, still want to continue to bet?Metaverse development has yet to see a way out
My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
kotlin中函数作为参数和函数作为返回值实例练习
Drools基本介绍,入门案例,基本语法
pc端判断当前使用浏览器类型
简易表白小页面
Path and the largest
Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things
MySQL stored procedure
PDF split/merge
爬虫文本数据清洗
VSCode插件:嵌套注释
充电效果模拟
加密生活,Web3 项目合伙人的一天
1782. Count the number of point pairs Double pointer