Skip to content

Overuse "Reference" in a query (RefOveruse)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL Major Yes 5 sql
performance

Description

Using ".Ref" to a field of a reference type will result in an implicit left join with the source table of this field, and it has no value, but only generates excessive load on the DBMS.

Examples

Query.Text = "Select Files.File.Ref, // error
   | Files.File
   | From
   | InternalFiles AS Files";

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:RefOveruse-off
// BSLLS:RefOveruse-on

Parameter for config

"RefOveruse": false