当前位置:网站首页>MySQL collection, here are all the contents you want
MySQL collection, here are all the contents you want
2022-06-28 02:31:00 【Minsk open source】
2、Mysql What are the technical characteristics of ?
Mysql Database software is a client or server system , These include : Supports multithreading of various client programs and libraries SQL The server 、 Different back ends 、 Factory wide application programming interfaces and management tools .
3、Heap What is a watch ?
HEAP Tables exist in memory , For temporary high-speed storage .
BLOB or TEXT Fields are not allowed
You can only use the comparison operator =,<, >,=>,=<HEAP Watch doesn't support AUTO_ INCREMENT
The index cannot be NULL
4、Mysql What is the default port of the server ?
Mysql The default port for the server is 3306.
5、 And Oracle comparison ,Mysql What are the advantages ?
Mysql Open source software , Ready to use , There is no need to pay .Mysql It's portable
With a command prompt GUI.
Use Mysql Query browser supports management
6、 How to distinguish between FLOAT and DOUBLE?
Here are FLOAT and DOUBLE The difference between :
Floating point number 8 Bit accuracy is stored in FLOAT in , And there are four bytes . Floating point numbers are stored in DOUBLE in , Accuracy of 18 position , There are eight bytes .
7、 distinguish CHAR_ LENGTH and LENGTH?
CHAR LENGTH It's the number of characters , and LENGTH Is the number of bytes .Latin The two data of the character are the same , But for Unicode And other codes , They are different .
Of course, this is only a small part, because there is too much content , Want to get more and more complete information about 《MySQL55 topic 》 The information can be found at the end of the article
Return to the right topic
《MySQL Performance optimized 21 Best practice 》
today , The operation of database is becoming the bottleneck of the whole application , This is for Web The application is especially obvious . About database performance , It's not just DBA What you need to worry about , And this is what we programmers need to pay attention to . When we design the database table structure , When operating a database ( Especially when looking up the table SQL sentence ), We all need to pay attention to the performance of data manipulation . here , We won't talk too much SQL Statement optimization , It's just aimed at MySQL this - - Web The most used databases . I hope the following optimization techniques are useful to you .
1. Optimize your query for query caching
Most of the MySQL All servers have query caching enabled . This is one of the most effective ways to improve sex , And this is being MySQL The database engine of . When many of the same queries are executed multiple times , These query results will be put into a cache , such , The subsequent same query will directly access the cached results without manipulating the table .
The main problem here is , For programmers , It's easy to overlook . because , Some of our query statements let MySQL Do not use cache . Please see the following example :
In general ,MySQL Can be divided into Server Layer and storage engine layer .
Server Layers include connectors 、 The query cache 、 analyzer 、 Optimizer 、 Actuators etc. , cover MySQL Most of the nuclei
Heart service function , And all the built-in functions ( Such as date 、 Time 、 Mathematics and cryptographic functions ), All cross storage engines
All the functions are implemented in this layer , Like stored procedures 、 trigger 、 View etc. .
The storage engine layer is responsible for data storage and extraction . Its architecture pattern is plug-in , Support InnoDB、MyISAM、Memory Wait for multiple storage engines . Now the most commonly used storage engine is InnoDB, It is from MySQL 5.5.5 Version began to be the default storage engine .
in other words , You execute create table When building the watch , If the engine type is not specified , The default is
InnoDB. however , You can also choose another engine by specifying the type of storage engine , For example create table
Use in statement engine=memory, To specify the use of the memory engine to create tables . Table data accessors for different storage engines
It's different , The supported functionality also varies , In a later article , We'll talk about the choice of engines .
It's not hard to see from the picture , Different storage engines share one Server layer , From the connector to the actuator .
about MySQL Learning from , From basic to in-depth advanced , We need to constantly understand and learn , To make more progress .
So how to learn , Is there the right way to guide , From junior to senior . Never mind , I have information from all kinds of cattle in my hand , Include 《MySQL Interview topics 》、《MySQL Performance optimized 21 Best practice 》《MySQL Practical notes 》《MySQL55 topic 》 etc. . have everything that one expects to find , Next, I will share the essences of these learning notes with you ! Now let's take a look
《MySQL55 topic 《 A big factory Java Analysis of interview questions + Back end development learning notes + The latest architecture explanation video + Practical project source code handout 》 Free open source Prestige search official account 【 Advanced programming 】 》:
1、 A watch , There are ID Since the primary key , When insert 了 17 After that , Delete the first 15,16,17 Bar record , And then Mysq| restart , Again insert- Bar record , This record is ID yes 18 still 15 ?
(1) If the table type is MyISAM, So 18
because MyISAM The table will automatically increase the maximum primary key ID Record it in a data file , restart MySQL Maximum of auto increment primary key ID It won't lose
(2) If the table type is InnoDB, So 15
InnoDB The table just adds the maximum value of the auto incrementing primary key ID Record in memory , So restart the database or perform the table OPTIMIZE operation , Will lead to the maximum ID The loss of
2、Mysql What are the technical characteristics of ?
Mysql Database software is a client or server system , These include : Supports multithreading of various client programs and libraries SQL The server 、 Different back ends 、 Factory wide application programming interfaces and management tools .
3、Heap What is a watch ?
HEAP Tables exist in memory , For temporary high-speed storage .
BLOB or TEXT Fields are not allowed
You can only use the comparison operator =,<, >,=>,=<HEAP Watch doesn't support AUTO_ INCREMENT
The index cannot be NULL
4、Mysql What is the default port of the server ?
Mysql The default port for the server is 3306.
5、 And Oracle comparison ,Mysql What are the advantages ?
Mysql Open source software , Ready to use , There is no need to pay .Mysql It's portable
With a command prompt GUI.
Use Mysql Query browser supports management
6、 How to distinguish between FLOAT and DOUBLE?
Here are FLOAT and DOUBLE The difference between :
Floating point number 8 Bit accuracy is stored in FLOAT in , And there are four bytes . Floating point numbers are stored in DOUBLE in , Accuracy of 18 position , There are eight bytes .
7、 distinguish CHAR_ LENGTH and LENGTH?
CHAR LENGTH It's the number of characters , and LENGTH Is the number of bytes .Latin The two data of the character are the same , But for Unicode And other codes , They are different .
Of course, this is only a small part, because there is too much content , Want to get more and more complete information about 《MySQL55 topic 》 The information can be found at the end of the article
Return to the right topic
《MySQL Performance optimized 21 Best practice 》
today , The operation of database is becoming the bottleneck of the whole application , This is for Web The application is especially obvious . About database performance , It's not just DBA What you need to worry about , And this is what we programmers need to pay attention to . When we design the database table structure , When operating a database ( Especially when looking up the table SQL sentence ), We all need to pay attention to the performance of data manipulation . here , We won't talk too much SQL Statement optimization , It's just aimed at MySQL this - - Web The most used databases . I hope the following optimization techniques are useful to you .
1. Optimize your query for query caching
Most of the MySQL All servers have query caching enabled . This is one of the most effective ways to improve sex , And this is being MySQL The database engine of . When many of the same queries are executed multiple times , These query results will be put into a cache , such , The subsequent same query will directly access the cached results without manipulating the table .
The main problem here is , For programmers , It's easy to overlook . because , Some of our query statements let MySQL Do not use cache . Please see the following example :
The top two SQL The difference between sentences is CURDATE() ,MySQL The query cache of does not work for this function . therefore , image NOW() and RAND() Or something like that SQL Functions do not turn on query caching , Because the return of these functions is variable . therefore , All you need is a variable to replace MySQL Function of , To turn on caching .
- EXPLAIN Yours SELECT Inquire about
Use EXPLAIN Keywords let you know MySQL How to deal with you SQL Of the statement . This can help you analyze the performance bottleneck of your query statement or table structure .
EXPLAIN The query result of will also tell you how your index primary key is used , How your data table is searched and sorted … wait , wait .
Choose one of your SELECT sentence ( Recommend choosing the most complicated , Having multiple tables joined ), Put keywords EXPLAIN Add to front . You can use phpmyadmin To do it . then , You will see a form . In the following example , We forgot to add group_ id Indexes , And there are table joins :
We are group_id Field with index :
id Indexes , And there are table joins :
[ Outside the chain picture transfer in …(img-NITJsCWZ-1652159128408)]
We are group_id Field with index :
[ Outside the chain picture transfer in …(img-wRKp81WA-1652159128409)]
边栏推荐
- 文件傳輸協議--FTP
- 系统管理员设置了系统策略,禁止进行此安装。解决方案
- Cvpr22 collected papers | hierarchical residual multi granularity classification network based on label relation tree
- [Yocto RM] 4 - Source Directory Structure
- fiddle如何使用代理
- Cesium Color 颜色(赋值)随机颜色
- Jenkins - Groovy Postbuild 插件丰富 Build History 信息
- Fundamentals of scala (3): operators and process control
- Anonymous Mount & named mount
- SQL injection bypass (2)
猜你喜欢

The system administrator has set the system policy to prohibit this installation. Solution

A set of sai2 brushes is finally finished! Share with everyone!

766. toplitz matrix

SQL injection bypass (2)

Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces

Dynamic Host Configuration Protocol

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩

《低代码解决方案》——覆盖工单、维修和财务全流程的数字化售后服务低代码解决方案

Domain Name System

Numpy----np. meshgrid()
随机推荐
Low code solution - a low code solution for digital after-sales service covering the whole process of work order, maintenance and Finance
SQL injection bypass (V)
How to use metauniverse technology to create a better real world
JS 随机数(随机数 小数)
Appium automation test foundation ADB common commands (I)
Cesium Color 颜色(赋值)随机颜色
Jenkins - accédez à la variable de paramètre personnalisée Jenkins, en traitant les espaces dans la valeur de la variable
Jenkins - built in variable access
New choice for database Amazon Aurora
Numpy----np. Tile() function parsing
图灵机启动顺序
王心凌、谭维维 - 山海(副歌加长版) 在线试听无损FLAC下载
Cesium 获取屏幕所在经纬度范围
Introduction to hybrid apps
技术人员如何成为技术领域专家
Leetcode topic [array] -228- summary interval
KVM related
[Yocto RM] 2 - Yocto Project Terms
geojson 格式说明(格式详解)
Cesium 点击获取经纬度(二维坐标)