《High Performance MySQL》翻译(2) 连接管理和安全 优化和执行
接上篇,第一章 MySQL架构和历史 连接管理和安全 每个客户连接在服务内部都有一个独立的线程处理。查询在这个单独的线程内运行,线程轮流在CPU或核心上运行。线程在服务端被缓存,所以不必针对每个新来线程进行创建和销毁。(注2)。 当客户端(应用)连接到
接上篇,第一章 MySQL架构和历史
连接管理和安全
每个客户连接在服务内部都有一个独立的线程处理。查询在这个单独的线程内运行,线程轮流在CPU或核心上运行。线程在服务端被缓存,所以不必针对每个新来线程进行创建和销毁。(注2)。
当客户端(应用)连接到MySQL服务的时候,服务端需要进行认证。认证是基于用户名,来访主机和密码的。X.509认证也可用于通过SSL(安全套接层)进行的连接。当客户端已经连接的时候,服务端会对每个请求校验该客户端是否具有操作权限。(例如:校验该客户端是否具有在wolrd数据库的Country表执行SELECT操作的权限。)
优化和执行
MySQL解析查询请求,生成内部结构(解析树),然后执行多种优化。包括重写查询,决定读取表的顺序,选择要使用的索引等等。你可以在查询中通过特殊的关键字给优化器指示,以引导其决定操作步骤。你也可以向服务端询问各种优化的方向。这会让你知道服务端进行了如何的决策,这对你重构查询和表结构以及优化设定以使服务高效运行给出了可参考的点。我们将在第六章讨论优化的细节。
优化器并不真正关心表所使用的存储引擎,但是存储引擎影响服务端对查询的优化方式。优化器向存储引擎询问其某些功能特性以及特定操作的耗时和表数据的统计。例如,一些存储引擎支持索引,可以有效支持的查询。你可以在第四和第五章了解到更多关于索引和表结构优化的信息。
在解析查询之前,服务端先检查查询缓存,查询缓存仅保存SELECT语句及其结果。如果某个查询请求与缓存中某条信息一致,那么服务端无需在解析,优化或者执行查询,它可以直接返回存储结果。我们将在第七章进行详细的说明。
注2:MySQL5.5以后的版本支持线程池插件,一个小型的线程池可以提供很多连接。
原文地址:《High Performance MySQL》翻译(2) 连接管理和安全 优化和执行, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

After updating to the latest win11 system, many users are not sure how to connect the controller to play games. For this reason, we have brought you a detailed tutorial on connecting the win11 controller today. If you haven't completed the connection yet, let's take a look at how to operate it. . How to connect the controller in win11: 1. Click Start below and then enter Windows Settings to open the "Control Panel". 2. After entering, you can find "View devices and printers" to enter. 3. At this point you can see the information about the controller device and just make the connection. 4. After the connection is successful, a √ appears, and the connection is completed.

The edge browser comes with a translation function that allows users to translate anytime and anywhere, which brings great convenience to users. However, many users say that the built-in translation webpage is missing. Then the edge browser automatically What should I do if the translation page I brought is missing? Let this site introduce how to restore the translated web page that comes with the Edge browser if it is missing. How to restore the translation webpage that comes with the Edge browser is missing 1. Check whether the translation function is enabled: In the Edge browser, click the three dots icon in the upper right corner, and then select the "Settings" option. On the left side of the settings page, select the Language option. Make sure "Translate&rd"

Many times we need to use a computer to connect to the printer for various printing operations, but sometimes some users will encounter the problem that win7 cannot connect to the printer 0x0000011b. The following is the specific solution. win7 cannot connect to the printer 0x0000011b1. Shortcut key "win+r", enter "regedit" 2. Find the following path "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print" 3. Right-click to create a new value "DWORD (32-bit) value (D) and Set the value to 0. Name the new project "RpcAuthnLevelPri

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

How does Sogou browser translate? When we usually use Sogou browser to check information, we will encounter some websites that are all in English. Because we can’t understand English, it is very difficult to browse the website. This is also very inconvenient. It doesn’t matter if you encounter this situation! Sogou Browser has a built-in translation button. With just one click, Sogou Browser will automatically translate the entire webpage for you? If you don’t know how to operate it, the editor has compiled the specific steps on how to translate it on Sogou Browser. If you don’t know how, follow me and read on! How to translate Sogou Browser 1. Open Sogou Browser, click the translation icon in the upper right corner 2. Select the type of translation text, and then enter the text that needs to be translated 3. Sogou Browser will automatically translate the text. At this point, the above Sogou Browsing operation is completed. How to translate all contents

According to news on July 22, today, the official Weibo of Xiaomi ThePaper OS announced that Xiaoai Translation has been upgraded. Real-time subtitles have been added to Japanese and Korean translations, and subtitle-free videos and live conferences can be transcribed and translated in real time. Face-to-face simultaneous interpretation supports translation into 12 languages, including Chinese, English, Japanese, Korean, Russian, Portuguese, Spanish, Italian, French, German, Indonesian, and Hindi. The above functions currently only support the following three new phones: Xiaomi MIX Fold 4 Xiaomi MIX Flip Redmi K70 Extreme Edition It is reported that in 2021, Xiao Ai’s AI subtitles will be added to Japanese and Korean translations. AI subtitles use Xiaomi’s self-developed simultaneous interpretation technology to provide a faster, more stable and accurate subtitle reading experience. 1. According to the official statement, Xiaoai Translator can not only be used in audio and video venues

Solutions to Restricted Network Connections in Win10 With the rapid development of technology, the Internet has become an indispensable part of people's lives. However, sometimes we may encounter some problems when connecting to the Internet on computers using the Windows 10 operating system, one of which is restricted connections. In this case, we cannot access web pages, download files, or use network functions normally. So, is there any way to solve this problem? This article will introduce you to several common solutions. 1. Check the network connection settings. First, I

When you use the Edge browser to access web pages, have you ever encountered a prompt that your connection is not a dedicated connection, causing web browsing to fail? How is this going? Many friends don’t know how to deal with this problem. You can take a look at the following three solutions. Method 1 (simple and crude): In the edge browser, you can try to solve the problem of the website being inaccessible by entering the settings and turning off the security function, and then blocking location permissions in the website permissions. It is important to note that the effectiveness and duration of this approach may vary, and specific effects cannot be determined. After restarting your browser, you can try visiting the website to see if the issue is resolved. Method 2: Adjust the keyboard to English input
