Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2universalStack: SQL
sqljoinsredundancyclean-code
Remove join conditions already implied by another condition
Drop extra ON conditions that are logically guaranteed by an existing one; they add noise without changing results.
PR: vinify-backend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codesql
| 1 | JOIN bottles b1 ON b1.vintage_id = v.id AND b1.main_profile_id = mp.id |
Explanation (EN)
Objašnjenje (HR)
Good example
New codesql
| 1 | JOIN bottles b1 ON b1.vintage_id = v.id |
Explanation (EN)
Objašnjenje (HR)