From 545c655e7385b8113e8756f7f72d038a6f424afd Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 22 Jan 2024 18:35:19 -0600 Subject: [PATCH] Add submission index --- .../0179_submission_result_lang_index.py | 19 +++++++++++++++++++ judge/models/submission.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 judge/migrations/0179_submission_result_lang_index.py diff --git a/judge/migrations/0179_submission_result_lang_index.py b/judge/migrations/0179_submission_result_lang_index.py new file mode 100644 index 0000000..3e43918 --- /dev/null +++ b/judge/migrations/0179_submission_result_lang_index.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.18 on 2024-01-23 00:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("judge", "0178_remove_user_script"), + ] + + operations = [ + migrations.AddIndex( + model_name="submission", + index=models.Index( + fields=["language", "result"], name="judge_submi_languag_874af4_idx" + ), + ), + ] diff --git a/judge/models/submission.py b/judge/models/submission.py index 5bc6863..43b8224 100644 --- a/judge/models/submission.py +++ b/judge/models/submission.py @@ -276,6 +276,7 @@ class Submission(models.Model): indexes = [ models.Index(fields=["problem", "user", "-points"]), models.Index(fields=["contest_object", "problem", "user", "-points"]), + models.Index(fields=["language", "result"]), ]