当前位置:网站首页>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)边栏推荐
- 简易表白小页面
- leetcode-399: division evaluation
- Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
- Set the browser scrollbar style
- Teach you how to configure Jenkins automated email notifications
- Crypto Life, a day in the life of a Web3 project partner
- Path and the largest
- CV-Model [3]: MobileNet v2
- "Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
- 成为比开发硬气的测试人,我都经历了什么?
猜你喜欢
随机推荐
leetcode-399:除法求值
Gateway routing configuration
力扣每日一题-第46天-704. 二分查找
项目开发软件目录结构规范
Chi-square distribution of digital image steganography
来自一位女测试工程师的内心独白...
C language applet -- common classic practice questions
MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法
系统需求多变如何设计
VSCode Plugin: Nested Comments
Drools规则属性,高级语法
leetcode-1161: Maximum in-layer element sum
Drools WorkBench的简介与使用
link与@import的区别
基于FPGA的售货机
两个有序数组间相加和的Topk问题
蛮力法/邻接表 广度优先 有向带权图 无向带权图
【AcWing 第62场周赛】
1.非类型模板参数 2.模板的特化 3.继承讲解
Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?









