Skip to content

chore(migrations): Drop unused index in Incident table #58449

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

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

isabellaenriquez
Copy link
Member

This PR gets rid of the index on id, date_added. This was originally added in #58207 to make a query in #58032 more efficient, however, after it was added, we determined that it was still really slow. We'll be using a different approach, so this one is no longer needed.

@isabellaenriquez isabellaenriquez self-assigned this Oct 19, 2023
@isabellaenriquez isabellaenriquez requested review from a team as code owners October 19, 2023 15:53
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 19, 2023
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0577_drop_latest_incident_index.py ()

--
-- Alter index_together for incident (1 constraint(s))
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_incident_id_date_added_785a850e_idx";

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #58449 (36650e4) into master (6322e4d) will increase coverage by 0.63%.
Report is 6 commits behind head on master.
The diff coverage is 100.00%.

❗ Current head 36650e4 differs from pull request most recent head bfd005d. Consider uploading reports for the commit bfd005d to get more accurate results

@@            Coverage Diff             @@
##           master   #58449      +/-   ##
==========================================
+ Coverage   79.93%   80.57%   +0.63%     
==========================================
  Files        5143     5144       +1     
  Lines      224629   224763     +134     
  Branches    37855    37880      +25     
==========================================
+ Hits       179553   181094    +1541     
+ Misses      39519    38131    -1388     
+ Partials     5557     5538      -19     
Files Coverage Δ
src/sentry/incidents/models.py 96.90% <100.00%> (ø)

... and 125 files with indirect coverage changes

# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
# have ops run this and not block the deploy. Note that while adding an index is a schema
# change, it's completely safe to run the operation after the code has deployed.
is_dangerous = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be dangerous, it's fast to drop an index.

@isabellaenriquez isabellaenriquez changed the title feat(migrations): Drop unused index in Incident table chore(migrations): Drop unused index in Incident table Oct 19, 2023
@isabellaenriquez isabellaenriquez merged commit 3eb8d9f into master Oct 19, 2023
@isabellaenriquez isabellaenriquez deleted the isabella/drop-incident-index branch October 19, 2023 18:52
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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