-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DB: create an index for
builds_build
table to improve Addons API (#…
…10840) * DB: create an index for `builds_build` table to improve Addons API After doing some research on #10831, I think that adding an index to this table will help a lot to improve queries performance on Addons API. This PR also fixes the `version.builds.last()` query to get the `Build` object that is finished and successfull. Otherwise, we will be returning a build that does not match with the HTML on S3. I think we should close #10831 and revert the commit on `rel*` branches. * Update readthedocs/proxito/views/hosting.py * Update readthedocs/proxito/views/hosting.py
- Loading branch information
Showing
3 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
readthedocs/builds/migrations/0054_add_builds_index_for_addons.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,20 @@ | ||
# Generated by Django 4.2.6 on 2023-10-18 11:43 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("builds", "0053_alter_version_build_data"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterIndexTogether( | ||
name="build", | ||
index_together={ | ||
("date", "id"), | ||
("version", "state", "type"), | ||
("version", "state", "date", "success"), | ||
}, | ||
), | ||
] |
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