# Offset Operation Cost
__*LIMIT clause*__
__*Optimize LIMIT offset operation*__

```8
tidb> SELECT id, name, mass FROM planets WHERE category_id = 1 ORDER BY mass DESC limit 20, 10;
+-----+--------------------+-------+
| id  | name               | mass  |
+-----+--------------------+-------+
|  37 | .Dbaxc?y}o2U6oJQNO | 82861 |
...
| 191 | `GM{f$&YuH{-|uuU3) | 76997 |
+-----+--------------------+-------+
10 rows in set (0.01 sec)

tidb> explain SELECT id, name, mass FROM planets WHERE category_id = 1 ORDER BY mass DESC limit 20, 10;
+-----------------------------------+---------+-----------+-------------------------------------+
| id                                | estRows | task      | access object                       |
+-----------------------------------+---------+-----------+-------------------------------------+
| Projection_7                      | 10.00   | root      |                                     |
| └─Limit_12                        | 10.00   | root      |                                     |
|   └─~!@IndexLookUp_26                | 30.00@!~   | root      |                                     |
|     ├─~!@IndexFullScan_17(Build)     | 95.68@!~   | cop[tikv] | table:planets, index:mass(mass, id) |
|     └─Selection_19(Probe)         | 30.00   | cop[tikv] |                                     |
|       └─TableRowIDScan_18         | 95.68   | cop[tikv] | table:planets                       |
+-----------------------------------+---------+-----------+-------------------------------------+
6 rows in set (0.00 sec)
```

------------------------------------------------------------

The execution plan IndexLookUp tells you the query have to access at least 30 rows. And there is a index full scan.