Skip to content

Commit 9f64ef7

Browse files
ianmacartneyConvex, Inc.
authored andcommitted
document limits on intervals (#43590)
GitOrigin-RevId: 3a0e006ac6137b3609097c2e1816ea37b89b4290
1 parent 7369776 commit 9f64ef7

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

npm-packages/docs/docs/functions/error-handling/error-handling.mdx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,28 +161,18 @@ See [Application Errors](/functions/error-handling/application-errors.mdx).
161161

162162
To ensure uptime and guarantee performance, Convex will catch queries and
163163
mutations that try to read or write too much data. These limits are enforced at
164-
the level of a single query or mutation function execution. The limits are:
165-
166-
Queries and mutations error out when:
167-
168-
- More than 16384 documents are scanned
169-
- More than 8MiB worth of data is scanned
170-
- More than 4096 queries calls to `db.get` or `db.query` are made
171-
- The function spends more than 1 second executing JavaScript
172-
173-
In addition, mutations error out when:
174-
175-
- More than 8192 documents are written
176-
- More than 8MiB worth of data is written
164+
the level of a single query or mutation function execution. The exact limits are
165+
listed in [Limits](/production/state/limits.mdx#transactions).
177166

178167
Documents are "scanned" by the database to figure out which documents should be
179168
returned from `db.query`. So for example `db.query("table").take(5).collect()`
180169
will only need to scan 5 documents, but `db.query("table").filter(...).first()`
181170
might scan up to as many documents as there are in `"table"`, to find the first
182171
one that matches the given filter.
183172

184-
Number of calls to `db.get` and `db.query` has a limit to prevent a single query
185-
from subscribing to too many index ranges.
173+
The number of calls to `db.get` and `db.query` has a limit to prevent a single
174+
query from subscribing to too many index ranges, or a mutation from reading from
175+
too many ranges that could cause conflicts.
186176

187177
In general, if you're running into these limits frequently, we recommend
188178
[indexing your queries](/database/reading-data/indexes/indexes.md) to reduce the

npm-packages/docs/docs/production/state/limits.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ These limits apply to each `query` or `mutation` function.
106106
| Data read | 16 MiB | Data not returned due to a `filter` counts as scanned |
107107
| Data written | 16 MiB |
108108
| Documents scanned | 32,000 | Documents not returned due to a `filter` count as scanned |
109+
| Index ranges read | 4,096 | The number of calls to `db.get` and `db.query`. |
109110
| Documents written | 16,000 |
110111
| Function return value size | 16 MiB |
111112

0 commit comments

Comments
 (0)