当前位置:网站首页>Briefly describe the differences between indexes, primary keys, unique indexes, and joint indexes in mysql, and how they affect the performance of the database (in terms of reading and writing)
Briefly describe the differences between indexes, primary keys, unique indexes, and joint indexes in mysql, and how they affect the performance of the database (in terms of reading and writing)
2022-07-06 06:51:00 【CHENFENG Muyang】
1. Preface
A brief description MySQL in , Indexes , Primary key , unique index , Joint index The difference between , What is the impact on the performance of the database ( From reading and writing )
This is a very classic MySQL Index interview questions , It is intended to see whether the interviewer understands several types of indexes, as well as the advantages and disadvantages of indexes
2. The difference between several index types
Index is a kind of data structure that helps database get data efficiently , The index file records the reference pointer to the data of the data table
A primary key is a special unique index , There can only be one primary key index in a table , The primary key index is used to uniquely identify a record
A unique index is used to ensure that a column contains only different values , in other words , Unique index can ensure the uniqueness of data records
A federated index is an index built through multiple columns , Such as the : Union primary key index , Union unique index
3. The impact of index reading and writing on database performance
read : Indexing can greatly improve the speed of data query , The index file will be generated after indexing , So essentially, indexing is space for time .
Write : The index lowers the insertion rate , Delete , The speed of updates , Because when the data changes , Will re index , Then the index file will be rebuilt , As a result, the operation of adding, deleting and modifying becomes slower
边栏推荐
- Pymongo gets a list of data
- AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 机器学习植物叶片识别
- [hot100] 739. Température quotidienne
- Apache dolphin scheduler source code analysis (super detailed)
- Database basics exercise part 2
- [English] Verb Classification of grammatical reconstruction -- English rabbit learning notes (2)
- 雲上有AI,讓地球科學研究更省力
- P5706 [deep foundation 2. Example 8] redistributing fat house water -- February 13, 2022
猜你喜欢
Do you really know the use of idea?
When my colleague went to the bathroom, I helped my product sister easily complete the BI data product and got a milk tea reward
My creation anniversary
[advanced software testing step 1] basic knowledge of automated testing
kubernetes集群搭建Zabbix监控平台
CS certificate fingerprint modification
电子书-CHM-上线CS
基于PyTorch和Fast RCNN快速实现目标识别
SQL Server manager studio(SSMS)安装教程
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
随机推荐
My seven years with NLP
Attributeerror: can 't get attribute' sppf 'on < module' models. Common 'from' / home / yolov5 / Models / comm
Phishing & filename inversion & Office remote template
Lesson 7 tensorflow realizes convolutional neural network
Wish Dragon Boat Festival is happy
编译,连接 -- 笔记 -2
Changes in the number of words in English papers translated into Chinese
基于购买行为数据对超市顾客进行市场细分(RFM模型)
前缀和数组系列
Pallet management in SAP SD delivery process
Day 245/300 JS forEach 多层嵌套后数据无法更新到对象中
kubernetes集群搭建Zabbix监控平台
电子书-CHM-上线CS
How to translate biomedical instructions in English
【Hot100】739. 每日溫度
【Hot100】739. 每日温度
查询字段个数
Financial German translation, a professional translation company in Beijing
The internationalization of domestic games is inseparable from professional translation companies
A method to measure the similarity of time series: from Euclidean distance to DTW and its variants