[ALOY-1136] SQL sync adapter: add method or optimize query for bulk-updates
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Models |
| Labels | n/a |
| Reporter | Tim Poulsen |
| Assignee | Unknown |
| Created | 2014-09-12T15:38:03.000+0000 |
| Updated | 2018-03-07T22:25:37.000+0000 |
Description
The SQL sync adapter's create/update method is currently best-suited to updating a single model at a time. The query could be optimized, or a separate method could be added to make bulk updates (multiple models in a single operation) so that such changes could be done in a more performant method.
Options might include
- update REPLACE INTO query to pass multiple VALUES
- execute multiple queries, but wrap in transaction so that there's a single atomic operation on the DB
A transaction should be used in either case to provide recovery in the case of an error during the update.
No comments