Move test name column to build2test
table
#2148
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The database schema currently has a
build2test
table which contains one row for each instance of a test run, in addition to atest
table which contains deduplicated test names. The joins required when searching forbuild2test
rows by test name, or for other relations by test name through thebuild2test
relation, incur a significant amount of indexing overhead, and lead to poor query plans in some cases. The presence of a project ID column on the test relation also encourages poor query design, by applying the project filter to the test relation instead of the build relation.This PR moves the test name to the
build2test
table, and drops thetest
table. This change is almost entirely internal, but has the potential to boost query performance in several places, as well as simplify future additions to the GraphQL API. The database migration associated with this change is large and may take a significant amount of time to apply on large CDash systems.