Skip to content
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
varungandhi-src merged 3 commits into
mainfrom
vg/add-exists
Aug 6, 2024
Merged

fix: Add Exists method to dbworker Store to avoid COUNT(*)#64297
varungandhi-src merged 3 commits into
mainfrom
vg/add-exists

Conversation

@varungandhi-src

@varungandhi-src varungandhi-src commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

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.

Test plan

Added test for the new Store method

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.
@cla-bot cla-bot Bot added the cla-signed label Aug 6, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Aug 6, 2024
Comment thread internal/workerutil/dbworker/store/store.go Outdated
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.
@varungandhi-src varungandhi-src merged commit bf4eb26 into main Aug 6, 2024
@varungandhi-src varungandhi-src deleted the vg/add-exists branch August 6, 2024 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants