当前位置:网站首页>MySQL interview questions
MySQL interview questions
2022-06-24 13:24:00 【Quinlan】
mysql The scenario of index creation and the problem of index invalidation ?
MySQL The scenarios for indexing are
- Create an index for fields with high query frequency ;
- Sort 、 grouping 、 Index fields with high query frequency ;
- If you need to set multiple columns as indexes , You can use a multi column index
- Select a unique index and try to use an index with less data
The reason for index failure
1. Function parameters or expressions appear in the index column
Solution : Calculate the value of the expression in advance
2. Use left blur
Solution : Try to avoid
3. Use OR Some fields of the query have no index
Solution :or Add an index to the field
4. No single quotation marks
surface 1: Person
+-------------+---------+
| Name | type |
+-------------+---------+
| PersonId | int |
| FirstName | varchar |
| LastName | varchar |
+-------------+---------+
PersonId Is the primary key of the above table
surface 2: Address
+-------------+---------+
| Name | type |
+-------------+---------+
| AddressId | int |
| PersonId | int |
| City | varchar |
| State | varchar |
+-------------+---------+
AddressId Is the primary key of the above table
Write a SQL Inquire about , Meet the conditions : No matter what person Is there address information , Both need to be provided based on the above two tables person For :
边栏推荐
- Attack Science: DDoS (Part 2)
- Richard Sutton, the father of reinforcement learning, paper: pursuing a general model for intelligent decision makers
- Gateway processing flow of zuul source code analysis
- What should I do if I fail to apply for the mime database? The experience from failure to success is shared with you ~
- Baidu simian: talk about persistence mechanism and rdb/aof application scenario analysis!
- How stupid of me to hire a bunch of programmers who can only "Google"!
- YOLOv6:又快又准的目标检测框架开源啦
- Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
- TCP triple handshake
- Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
猜你喜欢
‘高并发&高性能&高可用服务程序’编写及运维指南
工业物联网(IIoT)的八个主要趋势
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
#云原生征文#Ingress案例实战
Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)
线程同步的基石AbstractQueuedSynchronizer详解
"I, an idiot, have recruited a bunch of programmers who can only" Google "
Use abp Zero builds a third-party login module (I): Principles
nifi从入门到实战(保姆级教程)——环境篇
Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
随机推荐
3. caller service call - dapr
The agile way? Is agile development really out of date?
Appium installation
Detailed explanation of abstractqueuedsynchronizer, the cornerstone of thread synchronization
Megacli online management raid installation and use steps
手把手教你用AirtestIDE无线连接手机!
Kubernetes集群部署
How to create a new empty branch in the web development process of easyrtc?
SYSTEMd common component description
Definition and use of constants in C language
Introduction to reptile to give up 01: Hello, reptile!
Evolution of the message module of the play live series (3)
Why does the kubernetes environment require that bridge NF call iptables be enabled?
Use abp Zero builds a third-party login module (I): Principles
黄金年代入场券之《Web3.0安全手册》
[one picture series] one picture to understand Tencent Qianfan apaas
One hour is worth seven days! Ingenuity in the work of programmers
Cmput 379 explanation
Nifi from introduction to practice (nanny level tutorial) - environment
实现领域驱动设计 - 使用ABP框架 - 创建实体