forked from etianen/django-reversion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See etianen#885: Very slow VersionQuerySet.get_deleted
Version model: add index on (content_type, db). VersionQuerySet.get_deleted: filter by content_type and db before subquery to increase performance.
- Loading branch information
Dominik Bartenstein
committed
Aug 16, 2021
1 parent
1cc4023
commit e993175
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
reversion/migrations/0002_add_index_on_version_for_content_type_and_db.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 3.2.6 on 2021-08-16 18:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('reversion', '0001_squashed_0004_auto_20160611_1202'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddIndex( | ||
model_name='version', | ||
index=models.Index(fields=['content_type', 'db'], name='reversion_v_content_f95daf_idx'), | ||
), | ||
] |
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