Update all relations to use `disable_joins:` that cross join many DBs
As part of identified changes of PoC is to mark relations that cross-join DBs to prefer to use SELECT id instead of LEFT JOIN.
class Runner
has_many :projects, through: :runner_projects, disable_joins: true
end
Identified relations
| Model | Relation | Group (?) | Issue | Feature Flag |
|---|---|---|---|---|
| Environment | last_deployable | group::release | ||
| Environment | last_visible_deployable | group::release | ||
| Ci::Pipeline | deployments | group::release | ||
| Ci::Pipeline | environments | group::release | ||
| Ci::Runner | projects | group::verify | ||
| Ci::Runner | groups | group::verify | ||
| Packages::PackageFile | pipelines | group::package | ||
| Packages::Package | pipelines | group::package | ||
| Dast::Profile | ci_pipelines | group::security | ||
| Project | upstream_projects | group::verify | ||
| Project | downstream_projects | group::verify | ||
| Ci::Pipeline | security_scans | group::security | ||
| Security::Finding | pipelines | group::security | ||
| Vulnerabilities::Finding | pipelines | group::security |
Proposal
- Use backported
disable_joins: #336420 (closed) - For each relation use a lambda syntax to feature-flag it
- Validate performance and make
disable_joins: truepermament
Edited by Vijay Hawoldar