search
HomeDatabaseMysql Tutorial调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置 调试SQLSERVER (一)生成dump文件的方法 调试SQLSERVER (三)使用Windbg调试SQLSERVER的一些命令 大家知道在Windows里面,调试可以分为两个领域: 1、内核态调试 2、用户态调试 一般的程序都是运行

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (一)生成dump文件的方法
调试SQLSERVER (三)使用Windbg调试SQLSERVER的一些命令

 

大家知道在Windows里面,调试可以分为两个领域:

1、内核态调试

2、用户态调试

一般的程序都是运行在用户态,包括SQLSERVER,SQLServer 会依赖于操作系统的Win32/Win64 API去调用I/O或者其他他需要的服务

用户态程序调试和内核态程序调试是不太一样的,即使有些命令是一样的

 

还有另外一个要注意的是 live debug和dump file 

live debug:直接附加调试器到进程--使进程hang住,使被调试程序不能继续执行代码

dump file :通常是一个dump文件,dump文件是进程生成的当时这个进程的所有或部分内存内容,并且可以被调试器读取

full dump文件 通常的扩展名是.dmp ,文件里面一般不包含已经paged out 的内存内容

mini dump文件 通常的扩展名是.mdmp ,一般只包含线程栈和加载的模块名

 

Windbg: 是一个GUI调试器工具并且可以调试内核态和用户态程序,除了Windbg调试器 当然还有其他调试器 ,例如kd, cdb, ntsd

 


简单复习

应用程序以进程运行,这里我们关注的进程是sqlservr.exe ,在用户态调试下,我们会调试一个单独的进程,无论是使用live debug(附加进程方式)还是读取一个dump文件

在调试的时候都能看到进程的内存空间。在内核态调试里,我们可以看到所有进程和他们的内存空间(注意:在dump文件里面我们访问不到当生成dump文件的时候

已经被paged out 的那部分内存地址)

 

stack trace:单个线程里面执行的代码的栈,一个线程可以有用户态栈内核态栈,在用户态调试里面,我们只能看到每个线程的用户态栈

一个stack trace是一个线程的一系列函数调用的list

stack是一个LIFO结构(last in first out)意思是后进先出,术语叫做push stack 和pop stack

栈的读取是自底向上的,最上面的调用是当前正在执行的代码

下面的例子

Child SP (Stack Pointer)

RetAddr (Return Address)

stack trace里面可以跟踪系统的执行顺序和调用代码的返回,调试器会构造stack trace 给我们以便于更好的分析

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr<span>+</span><span>0x1c99e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr<span>+</span><span>0x4575</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr<span>+</span><span>0x3ea8</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr<span>+</span><span>0x1cfad</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr<span>+</span><span>0x579d9c</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!TlsGetValueForMsxmlSQL<span>+</span><span>0x4706d7</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr<span>+</span><span>0x12abb</span> 
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr<span>+</span><span>0x10fda</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr<span>+</span><span>0x12665</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr<span>+</span><span>0x5babb0</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr<span>+</span><span>0x5bc4b0</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr<span>+</span><span>0x5ba060</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr<span>+</span><span>0x5ba9ef</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span>

 

在配置调试器的过程中,最后的步骤是匹配符号,我们打开Windbg的时候我们必须设置我们的符号文件路径

Symbolic Debugging Files(符号调试文件):帮助调试器把内存里面的各自的函数,类,变量名在内存的位置 匹配到相应的内存地址和位移

如果没有Symbolic Debugging Files,那么我们将会看到下面只有memory addresses 的stack trace 

符号文件的扩展名通常是pdb(如果大家写C#代码的时候肯定都会看到过在debug的时候看到bin目录下会有debug符号文件),调试器能够很好地解析这种文件格式

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr<span>+</span><span>0x1c99e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr<span>+</span><span>0x4575</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr<span>+</span><span>0x3ea8</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr<span>+</span><span>0x1cfad</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr<span>+</span><span>0x579d9c</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!TlsGetValueForMsxmlSQL<span>+</span><span>0x4706d7</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr<span>+</span><span>0x12abb</span> 
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr<span>+</span><span>0x10fda</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr<span>+</span><span>0x12665</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr<span>+</span><span>0x5babb0</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr<span>+</span><span>0x5bc4b0</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr<span>+</span><span>0x5ba060</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr<span>+</span><span>0x5ba9ef</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span>

 

上面显示出我们的模块,sqlservr.exe 和正在执行的代码在地址空间里的位移,但是我们不知道具体的函数名,如果有符号映射的帮助(symbols mapped),我们可以获取到更有意义输出

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr!SOS_Scheduler::SwitchContext<span>+</span><span>0x84e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr!SOS_Scheduler::SuspendNonPreemptive<span>+</span><span>0xc5</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr!EventInternal<span>Spinlock<span><span>149</span>,<span>1</span>,<span>0</span><span>></span> <span>></span>::Wait<span>+</span><span>0x428</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr!ResQueueBase::Dequeue<span>+</span><span>0x19d</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr!CheckpointLoop<span>+</span><span>0x1aa</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!ckptproc<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr!SOS_Task::Param::<span>Execute</span><span>+</span><span>0x11b</span>
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr!SOS_Scheduler::RunTask<span>+</span><span>0xca</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr!SOS_Scheduler::ProcessTasks<span>+</span><span>0x95</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr!SchedulerManager::WorkerEntryPoint<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr!SystemThread::RunWorker<span>+</span><span>0x60</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr!SystemThreadDispatcher::ProcessWorker<span>+</span><span>0x12c</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr!SchedulerManager::ThreadEntryPoint<span>+</span><span>0x12f</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span></span></span>

从上面的输出的函数名我们可以看到Checkpoint 线程

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

上面看到worker thread在CHECKPOINT_QUEUE 队列里面等待CHECKPOINT 命令

大家可以看到加上符号文件之后,调试器会在stack trace相应的位置进行转换,例如在模块名那里加上模块名,在函数名那里加上函数名

<span>module_name<span>>!<span>function</span> call<span>></span>

<span>or</span>

<span>module_name<span>>!class_name<span>></span>::<span>method<span>/</span><span>function</span> call<span>></span></span></span></span></span></span>

 


设置符号路径

设置符号路径的作用是使调试器可以找到符号文件的位置并进行加载在调试的时候

简单介绍一下符号路径和公私有符号文件

私有符号文件:包含了调试会话中需要的所有符号信息(只对微软内部开放,微软私有财产)
公有符号文件:只是有选择地包含一些符号信息(对所有人开放)


符号信息隶属于指定的模块,只有调试器需要用到某个模块时,它的符号信息才有被加载和分析的必要

要在调试器中使用符号,我们必须首先告诉调试器这些符号文件的位置,也就是设置符号路径。符号路径可以是本地文件夹路径、可访问的UNC路径、或者是符号服务器路径

符号服务器:在调试过程中,需要涉及成千上万个符号文件,以及同一个符号文件存在不同平台下的不同符号文件版本的时候。

手动设置符号路径肯定是不现实的,于是引入了符号服务器的概念

符号服务器有一套命名规则,使得调试软件能够正确找到需要的符号文件。一般来说,符号服务器比较大,都是共用的,放在远程主机上。

为了降低网络访问的成本,又引入了符号缓存的概念,即将从服务器上下载到的符号文件,保存在本地缓存中,以后调试器需要符号文件的时候,先从缓存中寻找,找不到的时候再到服务器上下载

 

  1、设置符号路径

  设置符号路径的语法如下:

.sympath [+] [路径]

  如要覆盖原来的路径设置,使用新路径即可:

.sympath 

  要在原有路径的基础上添加一个新路径,可使用:

.sympath+ 

  如果不带参数,那么输出是当前设置的符号路径:

0:000> .sympath
Symbol search path is: <empty>  //尚未设置符号路径</empty>

  假如在调试时,我知道需要的符号文件位于一下文件夹"D:\MyPdb“。

0:000> .sympath D:\MyPdb  //覆盖原有符号路径
Symbol search path is: D:\MyPdb
Expanded Symbol search path is: d:\mypdb

  此时调试器将记录上面新的符号路径,但并不会从这个路径中加载任何符号,要指示调试器加载符号,可以使用元命令reload。

这个命令能枚举出进程地址空间中所有已加载的模块,并且尝试找出与各个模块相关的符号文件。

0:000> .reload
Reloading current modules
.....

  如果调试器在指定目录无法找到文件,那么它会输出错误提示:

*** ERROR:Symbol file could not be found. Defaulted to export symbols for xxx.dll

  当没有设置本地缓存路径时,那么调试器将使用调试软件的安装路径下的sym文件夹。

  要特别注意的是,使用.sympath改变或新增符号路径后,符号文件并不会自动更新,应再执行.reload命令以进行更新。

  

  2、符号服务器与符号缓存

  设置符号服务器的基本语法是:

SRV*[符号缓存]*服务器地址

  语法有SRV引导,符号缓存和服务器地址的前面各有一个星号引导。

  此外,我们总是应该把微软的公用符号库加入到我们的符号路径中:

.sympath+ srv**http://msdl.microsoft.com/download/symbols

  这是一台微软对外公开的服务器,使用http地址访问,不是所有人都能牢记这个网址,所以最好的办法就是使用.symfix命令(自动记忆了上面那个微软符号服务器地址),语法如下:

.symfix [+] [符号缓存地址]

  下面的命令等价于上面的.sympath命令,而不用输入长长的http地址。

0:010> .symfix c:\windows\symbols
0:010> .sympath
Symbol search path is: srv*
Expanded Symbol search path is: SRV*c:\windows\symbols*http://msdl.microsoft.com/download/symbols

以上设置后,当需要用到符号,Windbg将自动到服务器上去下载,然后保存在C:\windows\symbols

 

当然,我们也可以在计算机上面设置,设置方式是:

我的电脑=》高级系统设置=》高级Tab,点击环境变量,新建一个用户变量如

变量名:_NT_SYMBOL_PATH
变量值:SRV*D:\PDB*http://msdl.microsoft.com/download/symbols/

或者

在安装完符号文件之后,指定固定的路径

变量名:_NT_SYMBOL_PATH
变量值:C:\windows\symbols

 

2、重新加载

  如果对自己正在使用的符号文件感到疑惑,比如源代码和行号明显不匹配,最好就是重新加载一下符号文件。此命令语法如下:

.reload /f /v [模块名]
  .reload命令的作用是删除指定或所有已加载的符号文件,默认情况下,调试器不会立刻根据符号路径重新搜索并加载新的符号文件,而是推迟到调试器下一次使用此文件时。

  使用/f参数将破事调试器立刻搜索并重新加载新的符号文件。

  其它参数解释如下:

/v:将搜索过程中的详细信息都显示出来。
/i:不检查pdb文件的版本信息;
/l:只显示模块信息,内核模式下,和“lm n t”命令类似,但显示内容比后者更多,因为包含了用户模块信息;
/n:仅重载内核符号,不重载用户符号;
/o:强制覆盖符号库中的符号文件,即使版本相同;
/d:用户层模式下使用Windbg时的默认选项,重载调试器模块列表中的所有模块;
/s:内核模式下使用Windbg时的默认选项,重载系统模块列表中的所有模块,另外,如果调试器在用户模式下运行,要加载内核模块,也必须使用/s选项,否则调试器将只会在调试器模块列表中搜索而导致找不到内核模块;
/u:卸载指定模块。如发现当前符号版本不对,使用/u开关先卸载之再重新加载。

下面命令重新加载sqlservr模块

.reload <span>/</span>f  sqlservr.exe

 

 

上面讲了一大堆,什么符号服务器,什么符号缓存,但是我们一般只使用本地符号文件,实际上概括起来我们设置符号路径一般的做法就是

1、下载公有符号文件,并安装,然后设置

地址:http://msdn.microsoft.com/zh-cn/windows/hardware/gg463028

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

双击下载下来的安装包,然后安装

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

下面这个路径一定要记住!!

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 安装完毕之后就可以在E:\Symbols\路径下 看到安装好的pdb

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

pdb文件

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

2、在Windbg里面设置symbols文件夹的位置

我们随便加载一个mdmp文件

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

打开dump文件之后,在Windbg的命令框依次输入下面命令

.sympath  E:\Symbols

重新加载

.reload

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

然后再输入 .sympath 就会看到当前符号路径是E:\Symbols

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

当然,我们不可能每次调试dump文件的时候都指定一次符号路径,我们可以把符号路径添加到环境变量里

这样下次再打开Windbg的时候就不用再指定多一次符号路径

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

我们再次打开Windbg,可以发现Windbg会首先从环境变量里查找符号路径,下图看到Windbg已经查找成功

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

这样就省去了我们每次设置符号路径的麻烦


总结

这样我们的调试环境就弄好了,下篇会介绍Windbg的一些命令

 

参考文章:

http://blogs.msdn.com/b/askjay/archive/2009/12/29/basic-debugging-concepts-and-setup.aspx

关于符号路径,符号服务器,符号文件的更多内容请参考:Windbg符号与源码 《第二篇》

 

 

欢迎大家拍砖o(∩_∩)o 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the role of InnoDB redo logs and undo logs.Explain the role of InnoDB redo logs and undo logs.Apr 15, 2025 am 12:16 AM

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

What are the key metrics to look for in an EXPLAIN output (type, key, rows, Extra)?What are the key metrics to look for in an EXPLAIN output (type, key, rows, Extra)?Apr 15, 2025 am 12:15 AM

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

What is the Using temporary status in EXPLAIN and how to avoid it?What is the Using temporary status in EXPLAIN and how to avoid it?Apr 15, 2025 am 12:14 AM

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB

Describe the different SQL transaction isolation levels (Read Uncommitted, Read Committed, Repeatable Read, Serializable) and their implications in MySQL/InnoDB.Describe the different SQL transaction isolation levels (Read Uncommitted, Read Committed, Repeatable Read, Serializable) and their implications in MySQL/InnoDB.Apr 15, 2025 am 12:11 AM

MySQL/InnoDB supports four transaction isolation levels: ReadUncommitted, ReadCommitted, RepeatableRead and Serializable. 1.ReadUncommitted allows reading of uncommitted data, which may cause dirty reading. 2. ReadCommitted avoids dirty reading, but non-repeatable reading may occur. 3.RepeatableRead is the default level, avoiding dirty reading and non-repeatable reading, but phantom reading may occur. 4. Serializable avoids all concurrency problems but reduces concurrency. Choosing the appropriate isolation level requires balancing data consistency and performance requirements.

MySQL vs. Other Databases: Comparing the OptionsMySQL vs. Other Databases: Comparing the OptionsApr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

How does MySQL index cardinality affect query performance?How does MySQL index cardinality affect query performance?Apr 14, 2025 am 12:18 AM

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

MySQL: Resources and Tutorials for New UsersMySQL: Resources and Tutorials for New UsersApr 14, 2025 am 12:16 AM

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

Real-World MySQL: Examples and Use CasesReal-World MySQL: Examples and Use CasesApr 14, 2025 am 12:15 AM

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool