Skip to content

perf(crons): Drop the check-in config FK index - #131374

Merged
wedamija merged 2 commits into
masterfrom
danf/crons-drop-checkin-config-index
Nov 16, 2026
Merged

wedamija merged 2 commits into
masterfrom
danf/crons-drop-checkin-config-index

Conversation

@wedamija

@wedamija wedamija commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Part of a series that shrinks the indexes on sentry_monitorcheckin.

Drops the index on checkin_config_id. It was only needed to check that every check-in has a config, and now they all do. Nothing deletes configs, so the foreign key never needs it.

Merge order:

  1. perf(crons): Drop the check-in config FK index #131374 ← this PR
  2. ref(crons): Make the check-in config not null #131375 (post-deploy migration)
  3. perf(crons): Make the check-in timeout index partial #131376 (post-deploy migration)

@wedamija
wedamija requested review from a team as code owners November 16, 2026 21:25
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/monitors/migrations/0026_drop_checkin_config_index.py

for 0026_drop_checkin_config_index in monitors

--
-- Custom state/database change combination
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_monitorcheckin_checkin_config_id_17e2de71";

@wedamija
wedamija merged commit 93f7eae into master Nov 16, 2026
102 checks passed
@wedamija
wedamija deleted the danf/crons-drop-checkin-config-index branch November 16, 2026 22:26
wedamija added a commit that referenced this pull request Nov 16, 2026
Part of a series that shrinks the indexes on `sentry_monitorcheckin`.

Every check-in has a config now, so `checkin_config` becomes NOT NULL.
Post-deploy, because validating the constraint scans the whole table.

Merge order:
1. #131374
2. #131375 (post-deploy
migration) ← this PR
3. #131376 (post-deploy
migration)
wedamija added a commit that referenced this pull request Nov 16, 2026
Part of a series that shrinks the indexes on `sentry_monitorcheckin`.

Swaps the `(status, timeout_at)` index for a partial index on
`timeout_at` over in-progress check-ins, the only rows the timeout task
reads. Post-deploy, because it builds an index.

Merge order:
1. #131374
2. #131375 (post-deploy
migration)
3. #131376 (post-deploy
migration) ← this PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants