mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
DB indexes for the issue-lits (including filters)
simply by reasoning about what they should be; no performance testing (on the issue-list and on the event-ingestion) was done for these)
This commit is contained in:
33
issues/migrations/0010_issue_list_indexes.py
Normal file
33
issues/migrations/0010_issue_list_indexes.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 4.2.19 on 2025-02-18 09:28
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("issues", "0009_fill_stored_event_count"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name="issue",
|
||||
index=models.Index(
|
||||
fields=["is_resolved", "is_muted", "last_seen"],
|
||||
name="issues_issu_is_reso_eaf32b_idx",
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="issue",
|
||||
index=models.Index(
|
||||
fields=["is_muted", "last_seen"], name="issues_issu_is_mute_6fe7fc_idx"
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="issue",
|
||||
index=models.Index(
|
||||
fields=["is_resolved", "last_seen"],
|
||||
name="issues_issu_is_reso_0b6923_idx",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -118,6 +118,11 @@ class Issue(models.Model):
|
||||
indexes = [
|
||||
models.Index(fields=["first_seen"]),
|
||||
models.Index(fields=["last_seen"]),
|
||||
|
||||
# 3 indexes for the list view (state_filter)
|
||||
models.Index(fields=["is_resolved", "is_muted", "last_seen"]), # filter on resolved/muted
|
||||
models.Index(fields=["is_muted", "last_seen"]), # filter on muted
|
||||
models.Index(fields=["is_resolved", "last_seen"]), # filter on resolved
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user