-
-
Notifications
You must be signed in to change notification settings - Fork 691
Add additional composite index to reduce load from query. #4870
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
base: master
Are you sure you want to change the base?
Add additional composite index to reduce load from query. #4870
Conversation
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
dc6227d to
2113884
Compare
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
Signed-off-by: gbennett <[email protected]>
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
|
Fixed the linting errors in the last run. |
Signed-off-by: gbennett <[email protected]>
|
Added the missing @index reference. |
nscuro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial feedback. This would need to be thoroughly tested with other databases as well. Usually there is always something that, say, MSSQL doesn't support.
src/main/java/org/dependencytrack/upgrade/v4132/v4132Updater.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/upgrade/v4132/v4132Updater.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/upgrade/v4132/v4132Updater.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/upgrade/v4132/v4132Updater.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/upgrade/v4132/v4132Updater.java
Outdated
Show resolved
Hide resolved
…names/capitilization/etc. Signed-off-by: gbennett <[email protected]>
…sorting to indexes when they're being created. Signed-off-by: gbennett <[email protected]>
|
I've built this locally and run it against the H2 database with no errors/issues (including testing loading a BOM and analyzing). I'll work on testing other DBs. |
Signed-off-by: gbennett <[email protected]>
|
Tested with MS SQL and Postgres without issues. I did get the database to build successfully with MySQL, I wasn't able to actually connect to it and test functionality (issue with getting the frontend to hit the backend, something on my end I'm sure). Everything did start up though with no errors in the logs. |
|
@nscuro , you want to take another look at this? I'm guessing I need to bump the version of DT I'm pointing at for the upgrade piece. :) |
|
I'll have a other look and run some tests with the various databases over the coming days. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Description
Adds a number of indexes (mostly composite) to reduce load (primarily CPU) and response time. I'm not a Java dev by any means, while I believe I'm creating the indexes correctly please double check my work here.
Addressed Issue
Detailed statistics and information is available in #4869 . This should fix the CPU utilization and response time for the queries that are causing the highest load in our environment. There are likely a fair number of other indexes that could be added to improve performance, I tried to limit this to only the ones that had the highest cost in our environment.
Additional Details
These indexes were tested manually via index creation:
Checklist