Force index only on list & stats (#4734)
Following up on https://github.com/grafana/oncall/pull/4731
This commit is contained in:
parent
d30d69ba66
commit
71cdf355db
1 changed files with 1 additions and 1 deletions
|
|
@ -332,7 +332,7 @@ class AlertGroupView(
|
|||
alert_receive_channels_ids = list(alert_receive_channels_qs.values_list("id", flat=True))
|
||||
queryset = AlertGroup.objects.filter(channel__in=alert_receive_channels_ids)
|
||||
|
||||
if settings.ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX:
|
||||
if self.action in ("list", "stats") and settings.ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX:
|
||||
# workaround related to MySQL "ORDER BY LIMIT Query Optimizer Bug"
|
||||
# read more: https://hackmysql.com/infamous-order-by-limit-query-optimizer-bug/
|
||||
from django_mysql.models import add_QuerySetMixin
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue