This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix: Add Exists method to dbworker Store to avoid COUNT(*)#64297
Merged
Conversation
Running COUNT(*) on hot tables like lsif_indexes on Sourcegraph.com shows up on profiles when the number of executors is bumped to 30+, and when the table has 100K+ jobs. So avoid COUNT(*) where possible.
eseliger
approved these changes
Aug 6, 2024
This commit shows the brittle-ness of mock-based testing. Adding a new method and changing the implementation should be triggering a compile-time error for a 'fake' or similar, so that the invariants between various methods are respected. Checking the history/number of calls does not actually give any kind of confidence in the implementation.
9f396a1 to
cd16a4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Running
COUNT(*)on hot tables like lsif_indexes on Sourcegraph.comshows up on profiles when the number of executors is bumped to
30+, and when the table has 100K+ jobs. So avoid
COUNT(*)where possible.
Test plan
Added test for the new Store method