Tagged articles
1 articles
Page 1 of 1
Java Captain
Java Captain
Jan 26, 2020 · Databases

MySQL Slow Query Optimization: Reducing Execution Time from 30 Seconds to 0.19 Seconds

This article documents a MySQL slow‑query case where a 5‑million‑row table took over 30 seconds to run a GROUP BY query, explores several ineffective optimization attempts, reveals a client‑side limit issue, and finally solves the problem by forcing the correct index, cutting the runtime to under 0.2 seconds.

Index Optimizationdistinct vs group byexecution plan
0 likes · 5 min read
MySQL Slow Query Optimization: Reducing Execution Time from 30 Seconds to 0.19 Seconds