b/Post/migrations/0009_build_idx_date.py
new file mode 100644
@@ -0,0 +1,17 @@
+# Generated by Django 4.2.29 on 2026-03-13 19:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('Post', '0008_alter_buildfailure_task_buildfailure_idx_task_lev'),
+ ]
+
+ operations = [
+ migrations.AddIndex(
+ model_name='build',
+ index=models.Index(fields=['DATE'], name='idx_date'),
+ ),
+ ]
@@ -48,6 +48,11 @@ class Build(models.Model):
ERROR_TYPE = models.CharField(max_length=20, choices=ERROR_TYPE_CHOICES,
default=ErrorType.RECIPE)
+ class Meta:
+ indexes = [
+ models.Index(fields=['DATE'], name='idx_date'),
+ ]
+
def save(self, *args, **kwargs):
if self.ERROR_TYPE not in [e_type[0] for e_type in
self.ERROR_TYPE_CHOICES]:
models: index date to speed up pagination With large datasets running full table scans when pagenating or generating charts are unacceptably long. This index helps a great deal. Ideally the pagenation code would be changed to avoid needing table scans entirely but the index solves the issue for now. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> --- Post/migrations/0009_build_idx_date.py | 17 +++++++++++++++++ Post/models.py | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 Post/migrations/0009_build_idx_date.py