Opened 9 years ago
Closed 9 years ago
#25892 closed Cleanup/optimization (fixed)
Optimize SeparateDatabaseAndState.database_backwards() by caching intermediate state
Reported by: | Amos Onn | Owned by: | Amos Onn |
---|---|---|---|
Component: | Migrations | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The database_backwards of SeparateDatabaseAndState runs at O(n2) where n is the number of database_operations. For each operation, it regenerates the state up to it from the first operation. Instead, we could cache all the intermediate states, similar to the implementation of _migrate_all_backwards in the migration executor (or migrate in django 1.8.x).
Change History (4)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
Summary: | SeparateDatabaseAndState database_backwards is slow. → Optimize SeparateDatabaseAndState.database_backwards() by caching intermediate state |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 9 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
PR