-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the efficiency of
DbLog
migration for Django (#2949)
The old implementation was using Django's ORM to get the count and rows of certain rows in the `DbLog` table. However, this was generating extremely inefficient queries that made the migration run for days on big databases. A similar problem was encountered with the original SqlAlchemy implementation. That was solved in an earlier commit `80a0aa9117f399a5385a30ba0ce3e2afc7016a4e`, which created a more efficient query. We now replace the Django ORM solution with the same custom SQL query as used for SqlAlchemy. This should significantly improve the efficiency of this migration.
- Loading branch information
Showing
2 changed files
with
104 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters