Programmer DD
Apr 14, 2022 · Databases
How to Speed Up MySQL LIMIT Pagination from 16 s to 0.3 s with Subquery Optimization
This article demonstrates how a MySQL pagination query on a 9.5‑million‑row table that originally took over 16 seconds can be accelerated to under 0.4 seconds by moving the LIMIT condition into a subquery that selects only primary‑key IDs and then joining to retrieve the remaining columns, with detailed code and experimental verification.
InnoDBLimit OptimizationSubquery
0 likes · 10 min read
