BSL207 — Join with virtual table¶
Summary¶
Join with virtual table
Identifiers¶
| Field | Value |
|---|---|
| Rule code | BSL207 |
| Compatible alias | JoinWithVirtualTable |
| Severity | WARNING |
| Enabled by default | Yes |
| Implemented | Yes |
| Tags | query, performance |
Behavior¶
- The public identifier
BSL207and aliasJoinWithVirtualTableare stable. - The rule reports the cases documented on this page.
- Suppressions and project configuration are applied before publication.
- The rule requires neither an external analyzer nor network access.
Configuration and suppression¶
BSL### is the primary stable identifier. The compatible alias is accepted
in select, ignore, and compatible block suppression comments.
All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:
noqa:
bsl-disable:
- compatible
BSLLSform:
When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:
// noqa: BSL207
// code without this diagnostic
// noqa-enable: BSL207
// bsl-disable: BSL207
// code without this diagnostic
// bsl-enable: BSL207
// BSLLS:JoinWithVirtualTable-off
// code without this diagnostic
// BSLLS:JoinWithVirtualTable-on
To disable the rule until the end of the file, omit the closing
noqa-enable, bsl-enable, or BSLLS:…-on marker.
Opening and closing markers must belong to the same family.
Description¶
When writing queries, you should not use virtual tables joins. Only metadata objects or temporary tables should be joined to each other.
If the query uses a join to a virtual table (for example, AccumulationRegister.Products.Balance) and the query is slow, then it is recommended to move the data reading from the virtual table into a separate query with the results saved in a temporary table.