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

perf: optimize the performance of accessory query #19557

Merged
merged 2 commits into from Nov 22, 2023

Conversation

chlins
Copy link
Member

@chlins chlins commented Nov 9, 2023

  1. Add db index for subject_artifact_id in table artifact_accessory.
  2. Optimize the SQL of excluding the accessory for artifact count.

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@chlins chlins added the release-note/enhancement Label to mark PR to be added under release notes as enhancement label Nov 9, 2023
@chlins chlins requested a review from a team as a code owner November 9, 2023 03:04
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #19557 (5650e27) into main (17c17ff) will decrease coverage by 0.16%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #19557      +/-   ##
==========================================
- Coverage   45.38%   45.23%   -0.16%     
==========================================
  Files         244      244              
  Lines       13323    13323              
  Branches     2719     2719              
==========================================
- Hits         6046     6026      -20     
- Misses       6974     6995      +21     
+ Partials      303      302       -1     
Flag Coverage Δ
unittests 45.23% <ø> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 5 files with indirect coverage changes

@chlins chlins enabled auto-merge (squash) November 14, 2023 08:07
1. Add db index for subject_artifact_id in table artifact_accessory.
2. Optimize the SQL of excluding the accessory for artifact count.

Signed-off-by: chlins <chenyuzh@vmware.com>
@@ -97,7 +97,6 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denverdino/aliyungo v0.0.0-20191227032621-df38c6fa730c // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.5.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would this be removed? Is it not used indeed?

Copy link
Member Author

@chlins chlins Nov 14, 2023

Choose a reason for hiding this comment

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

We should not need this package, automatically removed after runninggo mod tidy.

@chlins chlins merged commit 43ccd2f into goharbor:main Nov 22, 2023
11 of 12 checks passed
wy65701436 pushed a commit to wy65701436/harbor that referenced this pull request Nov 22, 2023
1. Add db index for subject_artifact_id in table artifact_accessory.
2. Optimize the SQL of excluding the accessory for artifact count.

Signed-off-by: chlins <chenyuzh@vmware.com>
Signed-off-by: wang yan <wangyan@vmware.com>
altynbaev pushed a commit to altynbaev/harbor that referenced this pull request Jan 29, 2024
1. Add db index for subject_artifact_id in table artifact_accessory.
2. Optimize the SQL of excluding the accessory for artifact count.

Signed-off-by: chlins <chenyuzh@vmware.com>
Signed-off-by: Altynbaev Dinislam <altynbayevdr@sberautotech.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/enhancement Label to mark PR to be added under release notes as enhancement target/2.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants