Add submission indexes to optimize user_problems
This commit is contained in:
parent
ec2c2ccf13
commit
d2f261acfe
3 changed files with 64 additions and 41 deletions
|
@ -233,6 +233,11 @@ class Submission(models.Model):
|
|||
verbose_name = _("submission")
|
||||
verbose_name_plural = _("submissions")
|
||||
|
||||
indexes = [
|
||||
models.Index(fields=["problem", "user", "-points"]),
|
||||
models.Index(fields=["contest_object", "problem", "user", "-points"]),
|
||||
]
|
||||
|
||||
|
||||
class SubmissionSource(models.Model):
|
||||
submission = models.OneToOneField(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue