当前位置:网站首页>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
边栏推荐
- Office doc add in - Online CS
- [ 英语 ] 语法重塑 之 英语学习的核心框架 —— 英语兔学习笔记(1)
- Fedora/rehl installation semanage
- Market segmentation of supermarket customers based on purchase behavior data (RFM model)
- Pymongo gets a list of data
- Leetcode daily question (1870. minimum speed to arrive on time)
- Changes in the number of words in English papers translated into Chinese
- Day 248/300 关于毕业生如何找工作的思考
- How to do a good job in financial literature translation?
- 【刷题】怎么样才能正确的迎接面试?
猜你喜欢
Is it difficult for girls to learn software testing? The threshold for entry is low, and learning is relatively simple
kubernetes集群搭建Zabbix监控平台
My creation anniversary
【每日一题】729. 我的日程安排表 I
基于PyTorch和Fast RCNN快速实现目标识别
Brief introduction to the curriculum differences of colleges and universities at different levels of machine human major -ros1/ros2-
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
How much is the price for the seal of the certificate
Suspended else
女生学软件测试难不难 入门门槛低,学起来还是比较简单的
随机推荐
Apache dolphin scheduler source code analysis (super detailed)
Number of query fields
LeetCode每日一题(1870. Minimum Speed to Arrive on Time)
Day 246/300 SSH connection prompt "remote host identification has changed!"
Monotonic stack
接口自动化测试框架:Pytest+Allure+Excel
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models. common‘ from ‘/home/yolov5/models/comm
When my colleague went to the bathroom, I helped my product sister easily complete the BI data product and got a milk tea reward
CS certificate fingerprint modification
Apache DolphinScheduler源码分析(超详细)
Leetcode daily question (1870. minimum speed to arrive on time)
Introduction and underlying analysis of regular expressions
前缀和数组系列
万丈高楼平地起,每个API皆根基
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
MySQL high frequency interview 20 questions, necessary (important)
How much is the price for the seal of the certificate
Day 246/300 ssh连接提示“REMOTE HOST IDENTIFICATION HAS CHANGED! ”
L'Ia dans les nuages rend la recherche géoscientifique plus facile
Lesson 7 tensorflow realizes convolutional neural network