BSL273 — Virtual table call without parameters¶
Summary¶
Virtual table call without parameters
Identifiers¶
| Field | Value |
|---|---|
| Rule code | BSL273 |
| Compatible alias | VirtualTableCallWithoutParameters |
| Severity | WARNING |
| Enabled by default | Yes |
| Implemented | Yes |
| Tags | query, performance |
Behavior¶
- The public identifier
BSL273and aliasVirtualTableCallWithoutParametersare 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: BSL273
// code without this diagnostic
// noqa-enable: BSL273
// bsl-disable: BSL273
// code without this diagnostic
// bsl-enable: BSL273
// BSLLS:VirtualTableCallWithoutParameters-off
// code without this diagnostic
// BSLLS:VirtualTableCallWithoutParameters-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 using virtual tables in queries, you should specify all conditions related to it in the table parameters.
It is not recommended to refer to virtual tables using conditions in the WHERE section, etc.
Such a query will return the correct (in terms of functionality) result, but it will be much more difficult for the DBMS to choose the optimal plan for its execution. In some cases, this can lead to errors in the DBMS optimizer and a significant slowdown in query performance.
Examples¶
For example, a query uses the WHERE section to filter virtual table data:
Query.Text = "SELECT
| Good
|FROM
| AccumulationRegister.MyGoods.Turnovers()
|WHERE
| Warehouse = &Warehouse";
It is recommended that you limit the number of selected records as early as possible. To do this, pass conditions to the parameters of the virtual table.
Query.Text = "SELECT
| Good
|FROM
| AccumulationRegister.MyGoods.Turnovers(, Warehouse = &Warehouse)";
Sources¶
- Standard: Using virtual tables (RU)
- Standard: Effective use of the virtual table «Turnovers» (RU)
- 1C Recommendation: Using the Condition parameter when accessing a virtual table (RU) (RU)