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

refactor(db/build): drop source index, add event index #1228

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

wass3rw3rk
Copy link
Member

@wass3rw3rk wass3rw3rk commented Dec 18, 2024

source column was used by legacy deployment implementation so should be dropped. it also had high cardinality, so is likely relatively large on bigger installations.

event has become more of a bottleneck for some queries for very busy repos when querying builds by event. we recommend adding it.

the changes in this PR only affect new installations. to accommodate these in existing installations, drop the source index (concurrently on Postgres) and add the new one with CREATE INDEX CONCURRENTLY IF NOT EXISTS builds_event ON builds (event); (for Postgres).

probably still wise to create the index prior to upgrading unless you have the VELA_DATABASE_SKIP_CREATION or DATABASE_SKIP_CREATION flag set to true, since the default statements don't use CONCURRENTLY on Postgres.

@wass3rw3rk wass3rw3rk requested a review from a team as a code owner December 18, 2024 22:35
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.64%. Comparing base (72319ae) to head (156f535).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1228   +/-   ##
=======================================
  Coverage   56.64%   56.64%           
=======================================
  Files         623      623           
  Lines       35280    35280           
=======================================
  Hits        19986    19986           
  Misses      14620    14620           
  Partials      674      674           
Files with missing lines Coverage Δ
database/build/index.go 64.00% <100.00%> (ø)

Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

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

lgtm

@wass3rw3rk wass3rw3rk merged commit ada42d5 into main Dec 27, 2024
14 of 16 checks passed
@wass3rw3rk wass3rw3rk deleted the refactor/build-index branch December 27, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants