# Deep Paging Solutions (Continued...)

+ Optimized effects:


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

------------------------------------------------------------
```
SELECT id,k FROM t1 ORDER BY id LIMIT 10;
SELECT id,k FROM t1 WHERE id>${maxId} ORDER BY id LIMIT 10;
```

Use the first SQL query to start with 10 records, and then take the maximum value of id MaxID in these 10 records. The subsequent paginated SQL query uses MaxID as the starting point, and query the last 10 records greater than MaxID through the primary key index, so that the performance problem of deep paging LIMIT M, N is well avoided. . Let's see the effect:

(omitted)

Here you can see that after optimization, the time to get the same paging data has been reduced from 10.61 seconds above to less than 10ms, and this problem is solved by SQL.
