# Deep Paging Analysis

+ The larger the**offset** of**LIMIT**, the longer the**SQL** execution time


![left](./student-guide/diagram/01-22-1.png)

------------------------------------------------------------
We found that when the offset of LIMIT is larger, the longer the SQL execution time, look at the following execution plans separately:

(omitted)

As you can see from the execution plan, when LIMIT is 50000000,10, the optimizer estimates that the index scanned 50000010 row. Scanning such a large amount of data explains the slow execution. Why does LIMIT 50000000,10 scan so much data? Here is a brief explanation of LIMIT M, N, the first parameter M is the offset of the return record row (OFFSET), and the second parameter N is the maximum number of rows return. If only one parameter is given, it indicates the maximum number of row return, equivalent to M being 0. LIMIT M, N is to scan and skip M (OFFSET) rows of data row by row according to the specified order, and then fetches up to N row of data.
