From: Bernd Bleßmann Date: Fri, 22 Oct 2021 13:13:12 +0000 (+0200) Subject: Lieferplan: Geschwindigkeitssteigerung durch »NOT EXISTS« anstelle von »NOT IN« X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~317 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f5341298db5dbe7e14d0f97525f4f6226e5940c0;p=kivitendo-erp.git Lieferplan: Geschwindigkeitssteigerung durch »NOT EXISTS« anstelle von »NOT IN« --- diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index a94c8446b..6d7aaa908 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -199,12 +199,13 @@ sub delivery_plan_query_linked_items { (oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed AND $oe_owner - oi.id NOT IN ( + NOT EXISTS ( SELECT from_id FROM record_links rl WHERE - rl.from_table ='orderitems' AND - rl.to_table = 'delivery_order_items' + rl.from_table = 'orderitems' AND + rl.to_table = 'delivery_order_items' AND + rl.from_id = oi.id ) " ], # make emacs happy again: " ]