Track DB calls for sync processes
- Dominant language
- Clojure
- Stars
- 49.3k
- Forks
- 6.8k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 653
Description
Some places in our sync process have N+1 queries:
- in checking select privileges (PR: https://github.com/metabase/metabase/pull/37439)
- in syncing FKs (PR: https://github.com/metabase/metabase/pull/38970/files)
- in syncing fields (PR: https://github.com/metabase/metabase/pull/38828)
And I suspect there is probably more.
Let's start tracking the number of DB calls for the sync process as we do for API calls; this will help us identify these spots.
Contributor guide
Research direction
Start by reviewing the referenced pull requests for select-privilege checks, foreign-key syncing, and field syncing, then find the existing API-call tracking used as the model. Trace the sync-process entry points and identify how database calls can be counted across the process; done means sync DB-call counts are recorded and the existing N+1 areas can be detected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend, databases, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100