When creating a batch of writes using the bulk interface, only inserts are coalesced, resulting in far many updates and delete roundtrips then expected.
bulk = mongoc_collection_create_bulk_operation() mongoc_bulk_operation_insert(bulk, document1); mongoc_bulk_operation_insert(bulk, document2); mongoc_bulk_operation_insert(bulk, document3); mongoc_bulk_operation_execute(bulk);
Results in 1 round trip.
bulk = mongoc_collection_create_bulk_operation() mongoc_bulk_operation_update(bulk, selector1, document1); mongoc_bulk_operation_update(bulk, selector2, document2); mongoc_bulk_operation_update(bulk, selector3, document3); mongoc_bulk_operation_execute(bulk);
Results in 3 round trip.
bulk = mongoc_collection_create_bulk_operation() mongoc_bulk_operation_delete(bulk, selector1); mongoc_bulk_operation_delete(bulk, selector2,); mongoc_bulk_operation_delete(bulk, selector3); mongoc_bulk_operation_execute(bulk);
Results in 3 round trip.
- is depended on by
-
CDRIVER-653 Rearrange unordered bulk ops
- Closed
- is related to
-
CDRIVER-255 New write operation method for insert, update, remove (and API for bulk operations)
- Closed
- related to
-
PHPC-193 Bulk delete and updates result in one roundtrip per document
- Closed
- tested by
-
CDRIVER-659 Fuzz-test bulk ops
- Closed
- links to