OFFSET clauses restrict the operation of:
- A selection query, including when it occurs
as part of
LIMIT restricts the operation to only retrieve
limit_val number of rows.
OFFSET restricts the operation to skip the first
offset_value number of rows.
It is often used in conjunction with
LIMIT to "paginate" through retrieved rows.
OFFSET to implement pagination can be very slow for large tables. We recommend using keyset pagination instead.
For PostgreSQL compatibility, CockroachDB also supports
limit_val ROWS ONLY and
FETCH NEXT limit_val ROWS ONLY as aliases
limit_val is omitted, then one row is fetched.
For example uses with
SELECT, see Limiting Row Count and