Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alert group search to force index in MySQL #4731

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

matiasb
Copy link
Contributor

@matiasb matiasb commented Jul 24, 2024

Related to https://github.com/grafana/oncall-private/issues/2679

Confirmed the query rewriting works via MySQL query logs (index is also forced for the stats queries):

2024-07-24T19:50:59.482751Z 3977 Query SELECT alerts_alertgroup.idFROMalerts_alertgroup FORCE INDEX (alert_group_list_index) WHERE (alerts_alertgroup.channel_id IN (13) AND (1) AND (alerts_alertgroup.public_primary_keyLIKE 'test' ORalerts_alertgroup.inside_organization_numberLIKE 'test' ORalerts_alertgroup.web_title_cacheLIKE '%test%') ANDalerts_alertgroup.root_alert_group_id IS NULL AND ((alerts_alertgroup.silenced= ('0') ANDalerts_alertgroup.acknowledged= ('0') ANDalerts_alertgroup.resolved = ('0')) OR (alerts_alertgroup.acknowledged= ('1') ANDalerts_alertgroup.resolved= ('0'))) ANDalerts_alertgroup.started_at>= '2024-06-24 19:50:58' ANDalerts_alertgroup.started_at<= '2024-07-24 19:50:58') ORDER BYalerts_alertgroup.started_atDESC LIMIT 26

Rewriting will only be applied to the alert group search queries, when the feature flags are enabled. Dependency was already listed as a requirement.

@matiasb matiasb added pr:no public docs Added to a PR that does not require public documentation updates release:ignore PR will not be added to release notes labels Jul 24, 2024
@matiasb matiasb marked this pull request as ready for review July 24, 2024 20:05
@vstpme vstpme added this pull request to the merge queue Jul 25, 2024
Merged via the queue into dev with commit 845940d Jul 25, 2024
27 checks passed
@vstpme vstpme deleted the matiasb/mysql-force-ag-index branch July 25, 2024 09:29
github-merge-queue bot pushed a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates release:ignore PR will not be added to release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants