select link.id, position.weightquantity as "weightQuantity" from…
- User
select link.id, position.weight_quantity as "weightQuantity" from supply_order_position_unit_link as link left join operation.unit as unit on link.id_unit = unit.id left join supply_order_weight_position as position on link.id_position = position.id left join "order" on unit.id_order = "order".id left join supply_order on "order".id_supply_order = supply_order.id and position.id_supply_order = supply_order.id where link.id = $1::bigint and "order".deleted = 0 and unit.deleted = 0 and link.deleted = 0 and position.deleted = 0
optimize
- Assistant
This query does not seem to have any obvious performance problems that can be optimized further. However, you may consider creating appropriate indexes on the columns being used in the join and where clauses to improve query performance. It is also recommended to periodically analyze and vacuum the tables involved in the query to optimize their storage and performance.