当前位置:网站首页>[MySQL learning notes 24] index design principles
[MySQL learning notes 24] index design principles
2022-06-28 14:34:00 【yqs_ two hundred and eighty-one million eight hundred and seven】
1. Only when there is a large amount of data can the index be established , Otherwise, the effect is not obvious . A few w The index is not improved much when the index is changed , To dozens w The article will be improved , But it's not too big , A few hundred w Thousands of w There is a big difference between using an index and not using an index .
2. If the query frequency is not high , There's no need to index
3. Index the query criteria
4. Try to select the field with high discrimination as the index , It doesn't make sense to use gender as a field , It is no different from full table query . The unique index discrimination is the highest , Because unique indexes force field values to be unique
5. Try to use a union index , Reduce single column index , Try to overwrite the index when querying , Avoid back table queries
6. Reasonably control the number of indexes , More indexes is not better , Too many will affect the efficiency of addition, deletion and modification .
7. If the index column cannot store null value , Please use... When creating the table not null constraint . When the optimizer knows whether each column contains null When the value of , It can better select indexes .
边栏推荐
- 2022中式烹调师(高级)试题及在线模拟考试
- Reverse a stack with recursive functions and stack operations only
- 哪个证券公司最大最安全 怎么办理开户最安全
- 腾讯再遭大股东Prosus减持:后者还从京东套现37亿美元
- 线程终止的 4 种方式
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- How to design data visualization platform
- Why can't Bert completely kill the BM25??
- 单一职责原则
- 外贸SEO 站长工具
猜你喜欢

Foreign trade SEO Webmaster Tools

Open source invites you to participate in openinfra days China 2022. Topic collection is in progress ~

Introduction to common components of IOT low code platform

Work study management system based on ASP

What is the progress of China open source with 7.55 million developers?

IonQ联合GE Research证实:量子计算在风险聚合上有巨大潜力

Rslo: self supervised lidar odometer (real time + high precision, icra2022)

How to design data visualization platform

Four visualization tools are recommended to solve 99% of large screen visualization projects!

Tencent cloud international ECS has no network after logging in. How to troubleshoot?
随机推荐
Clipping of raster vector data
How to back up MySQL_ The most complete MySQL backup method in history
优巨新材冲刺深交所:拟募资6.5亿 年营收3.33亿
Kwai investment e-commerce service provider Yixin optimization
3. Overall UI architecture of the project
Recommendation letter brain correspondent: if love is just a chemical reaction, can you still believe in love?
Unable to create process using 'd:\program file
Cat dog queue
sort
2022 welder (technician) examination question bank simulated examination platform operation
2022中式烹调师(高级)试题及在线模拟考试
MySQL slave error: "you cannot 'alter' a log table“
Q-Tester 3.2:适用于开发、生产和售后的诊断测试软件
Reverse a stack with recursive functions and stack operations only
Who is the main body of the waiting insurance record? Record in the local network security, right?
n-queens problem
智联招聘基于 Nebula Graph 的推荐实践分享
线程终止的 4 种方式
Leetcode(88)——合并两个有序数组
Force deduction solution summary 522- longest special sequence II