# Case Studies - Which query should be optimize first?
![`smart`](TiDBMonitorSQLPerf0401_en_001_20240125.png)
![`smart`](TiDBMonitorSQLPerf0402_en_001_20240125.png)
![`smart`](TiDBMonitorSQLPerf0403_en_002_20240125.png)

+ Query <C>
  + `# Exec` reaches 20.0K
  + `Total Latency` is 37.0 seconds
  + Query <C> should be optimized first

------------------------------------------------------------------------------
In example `<C>`, the `Mean Latency` is 1.9ms, the `Mean Visible Versions Per Query` is 12, and the `Mean Meet Versions Per Query` is 13. Although these figures are not very high, the `# Exec` reaches 20.0K times, which translates to a `Mean Visible Versions` impact of `12 x 20.0K = 240.0K` and a `Mean Meet Versions` impact of `260.0K`. Additionally, the `Total Latency` is 37.0 seconds. Optimizing this statement would substantially enhance the performance of the database, making it a high-priority candidate for optimization.