Skip to content

Commit

Permalink
MongoDB: Decrease default batch size to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 12, 2024
1 parent 42f22ee commit 6030d83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cratedb_toolkit/io/mongodb/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __attrs_post_init__(self):

@cached_property
def batch_size(self) -> int:
return int(self.address.uri.query_params.get("batch-size", 500))
return int(self.address.uri.query_params.get("batch-size", 100))

@cached_property
def filter(self) -> t.Union[str, None]:
Expand Down
5 changes: 3 additions & 2 deletions doc/io/mongodb/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ see [](#file-import-tutorial).
## Options

### Batch Size
The default batch size is 500. You can adjust the value by appending the HTTP
URL query parameter `batch-size` to the source URL, like
The default batch size is 100, but for many datasets a much larger batch size
is applicable for most efficient data transfers. You can adjust the value by
appending the HTTP URL query parameter `batch-size` to the source URL, like
`mongodb+srv://managed.mongodb.net/ticker/stocks?batch-size=5000`.

### Filter
Expand Down

0 comments on commit 6030d83

Please sign in to comment.