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

[PM-13843] Optimize collectioncipher readbyuserid #4916

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

rkac-bw
Copy link
Contributor

@rkac-bw rkac-bw commented Oct 18, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13843

📔 Objective

Database Optimization:

Stored procedure [Collectioncipher_ReadByUserId] has regressed in performance and is affecting CPU usage greatly. It has been rewritten to just use inner joins and a union all to maximize index usage.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@rkac-bw rkac-bw requested a review from a team as a code owner October 18, 2024 16:33
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.79%. Comparing base (91409a4) to head (9a50cae).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4916   +/-   ##
=======================================
  Coverage   41.79%   41.79%           
=======================================
  Files        1364     1364           
  Lines       64003    64003           
  Branches     5871     5871           
=======================================
  Hits        26751    26751           
  Misses      36048    36048           
  Partials     1204     1204           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rkac-bw rkac-bw changed the title Optimize collectioncipher readbyuserid {DBOPS-1} Optimize collectioncipher readbyuserid Oct 18, 2024
@rkac-bw rkac-bw changed the title {DBOPS-1} Optimize collectioncipher readbyuserid [DBOPS-1] Optimize collectioncipher readbyuserid Oct 18, 2024
Copy link
Contributor

github-actions bot commented Oct 18, 2024

Logo
Checkmarx One – Scan Summary & Detailsd0baa4a7-4424-4f80-8670-6be29824a93f

No New Or Fixed Issues Found

@rkac-bw rkac-bw changed the title [DBOPS-1] Optimize collectioncipher readbyuserid [PM-13843] Optimize collectioncipher readbyuserid Oct 18, 2024
WHERE
OU.[Status] = 2
AND CU.[CollectionId] IS NULL
END
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ Newline at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@rkac-bw rkac-bw merged commit 27760bd into main Oct 18, 2024
55 checks passed
@rkac-bw rkac-bw deleted the optimize_collectioncipher_readbyuserid branch October 18, 2024 17:28
cyprain-okeke pushed a commit that referenced this pull request Oct 30, 2024
* Optimise stored procedure Collectioncipher_ReadByUserId

* Optimise stored procedure Collectioncipher_ReadByUserId

* Optimise stored procedure Collectioncipher_ReadByUserId
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.

2 participants