# Case Studies - How to Prioritize the SQL Statements for Tuning
![`smart`](TiDBMonitorSQLPerf03_en_001_20240125.png)

+ `Mean Visible Versions Per Query`: the average number of data versions accessible to each query, excluding those versions that should have been garbage collected
+ `Mean Meet Versions Per Query`: The average number of data versions accessible to each query, including those versions that should have been garbage collected but have not yet been removed

------------------------------------------------------------------------------
There are two additional important attributes to consider: `Mean Meet Versions Per Query` and `Mean Visible Versions Per Query`.

- `Mean Visible Versions Per Query`: the average number of data versions accessible to each query, excluding those versions that should have been garbage collected
- `Mean Meet Versions Per Query`: The average number of data versions accessible to each query, including those versions that should have been garbage collected but have not yet been removed

It is advisable to begin by sorting the statements based on `# Exec` and start analyzing from the most frequently executed SQL query. By calculating their impact on TiKV's read operations (`Mean Meet Versions Per Query` multiplied by `# Exec`), `Total Latency`, and other metrics, you can assess whether optimization is necessary. The highest optimization priority usually lies with the most frequently executed SQL statements. Below are three examples illustrating this approach.