Skip to content

Commit 4f17670

Browse files
authored
Merge pull request #101561 from timsander1/master
continuation token clarifications
2 parents 4904b19 + 30bbdb5 commit 4f17670

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

articles/cosmos-db/sql-query-offset-limit.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ OFFSET <offset_amount> LIMIT <limit_amount>
3232

3333
## Remarks
3434

35-
Both the OFFSET count and the LIMIT count are required in the OFFSET LIMIT clause. If an optional `ORDER BY` clause is used, the result set is produced by doing the skip over the ordered values. Otherwise, the query will return a fixed order of values. This clause is now supported for queries within a single partition as well as cross-partition queries.
35+
Both the `OFFSET` count and the `LIMIT` count are required in the `OFFSET LIMIT` clause. If an optional `ORDER BY` clause is used, the result set is produced by doing the skip over the ordered values. Otherwise, the query will return a fixed order of values.
36+
37+
The RU charge of a query with `OFFSET LIMIT` will increase as the number of terms being offset increases. For queries that have multiple pages of results, we typically recommend using continuation tokens. Continuation tokens are a "bookmark" for the place where the query can later resume. If you use `OFFSET LIMIT`, there is no "bookmark". If you wanted to return the query's next page, you would have to start from the beginning.
38+
39+
You should use `OFFSET LIMIT` for cases when you would like to skip documents entirely and save client resources. For example, you should use `OFFSET LIMIT` if you want to skip to the 1000th query result and have no need to view results 1 through 999. On the backend, `OFFSET LIMIT` still loads each document, including those that are skipped. The performance advantage is a savings in client resources by avoiding processing documents that are not needed.
3640

3741
## Examples
3842

0 commit comments

Comments
 (0)