Support the new RawFileDiffData migration in condensediffs.
Review Request #6227 — Created Aug. 13, 2014 and submitted
condensediffs has been updated to handle the migration of
LegacyFileDiffData entries to RawFileDiffData. A lot of work went into
optimizing this. These are converted in batches, with minimal SQL
queries on a modern database (read: not sqlite3).A run of condensediffs on a copy of a real-world database containing
650,000 diffs (all stored in LegacyFileDiffData entries) took 15 minutes
to convert, with a space savings of 80% (3.6GB down to 714MB).
Ran this many, many times without problems.
This was tested on sqlite, MySQL, and PostgreSQL.
Description | From | Last Updated |
---|---|---|
We should probably mark these strings for translation. Here and below. |
|
|
Since there's only one entry here, how about the single-line format? % {'count': total_count} |
|
|
You need to pass since into N_ here as a third argument (so it knows which one to choose) |
|
|
What if these tables already exist (say, a previous run of this failed in some unexpected way)? |
|
-
-
reviewboard/diffviewer/management/commands/condensediffs.py (Diff revision 1) We should probably mark these strings for translation. Here and below.
-
reviewboard/diffviewer/management/commands/condensediffs.py (Diff revision 1) Since there's only one entry here, how about the single-line format?
% {'count': total_count}
-
reviewboard/diffviewer/managers.py (Diff revision 1) What if these tables already exist (say, a previous run of this failed in some unexpected way)?
Change Summary:
- Localized text.
- Condensed a dictionary to one line.
- Added some
DROP TABLE IF EXISTS
statements.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+325 -100) |

-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/management/commands/condensediffs.py reviewboard/diffviewer/managers.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/management/commands/condensediffs.py reviewboard/diffviewer/managers.py
-
-
reviewboard/diffviewer/management/commands/condensediffs.py (Diff revisions 1 - 2) You need to pass
since
intoN_
here as a third argument (so it knows which one to choose)