Tagged articles
3 articles
Page 1 of 1
Wukong Talks Architecture
Wukong Talks Architecture
May 14, 2026 · Databases

How to Cut a Production MySQL 8.0 LATERAL Query from 3 s to 0.8 s

The article walks through diagnosing a slow MySQL 8.0 query that scans 77,724 rows and performs a costly filesort, then rewrites it with a LATERAL join and a new index, reducing execution time to about 0.75 seconds on 30 k rows while explaining the differences between ordinary subqueries and LATERAL, and highlighting the need for deterministic ordering when timestamps duplicate.

LATERALexecution planindex
0 likes · 8 min read
How to Cut a Production MySQL 8.0 LATERAL Query from 3 s to 0.8 s