Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Code smell |
BSL |
Major |
Yes |
10 |
sql standard performance |
You should not use FULL OUTER JOIN in queries, especially in PostgreSQL database. It is better to rewrite query without FULL OUTER JOIN.
Query below will lead to high load on PostgreSQL database.
Procedure Test1()
Query = New Query;
Query.Text = "SELECT
| Goods.Product AS Product,
| ISNULL(SalesPlan.Sum, 0) AS PlanSum,
| ISNULL(SalesActual.Sum, 0) AS ActualSum
|FROM
| Goods AS Goods
| LEFT JOIN SalesPlan AS SalesPlan
| FULL OUTER JOIN SalesActual AS SalesActual // Should trigger here
| ON SalesPlan.Product = SalesActual.Product
| ON Goods.Product = SalesPlan.Product";
EndProcedure
- Ограничение на использование конструкции "ПОЛНОЕ ВНЕШНЕЕ СОЕДИНЕНИЕ" в запросах (RU)
- Руководство администратора, особенности использования PostgreSQL (RU)
// BSLLS:FullOuterJoinQuery-off
// BSLLS:FullOuterJoinQuery-on
"FullOuterJoinQuery": false