# Potential Performance Bottlenecks for Investigation
+ In SQL Tuning, we focus on step 2
![`smart`](TiDBQueryProcessing01P_aa_005_20230912.png)
------------------------------------------------------------------------------
During the execution of SQL statements, performance issues can arise at the following stages:

1. Performance bottlenecks may occur during the SQL parsing and compiling stages, which involve generating execution plans.
2. The generated execution plan may be suboptimal.
3. The TiDB Server might send an excessive number of tasks to TiKV Servers, leading to performance bottlenecks. This can result in errors such as: `ERROR: Coprocessor task terminated due to exceeding the deadline`.
4. TiKV layer may encounter performance issues.
5. Network congestion may occur when returning data, either during the transfer from TiKV Servers to the TiDB Server or from the TiDB Server back to the application.

The aforementioned steps, 1 through 5, primarily occur within the TiDB cluster itself. In this course, we will focus on the second step: improving suboptimal execution plans. The remaining steps, 1, 3, 4, and 5, will be covered in a separate training course titled "TiDB Cluster Performance Tuning."