Planning/Requisition Worksheet order tracking policy is slow

lzrlzr Member Posts: 264
edited 2013-10-17 in SQL Performance
After enabling order tracking policy it takes like four times as long to run the planning worksheet (from one hour to four). I have looked through the inventory profile offsetting and can find a lot of find('-') and was thinking of replacing them with findset but then I read that I should only do this if the records retrieved are less than record set on the database (which is 500).
When looking at the code I also found this which doesn't seem that good:
[b]DeleteTracking(VAR SKU : Record "Stockkeeping Unit";ToDate : Date)[/b]
ActionMsgEntry.SETCURRENTKEY("Reservation Entry");

WITH ReservEntry DO BEGIN
  RESET;
  SETCURRENTKEY("Item No.","Variant Code","Location Code");
  SETRANGE("Item No.",SKU."Item No.");
  SETRANGE("Variant Code",SKU."Variant Code");
  SETRANGE("Location Code",SKU."Location Code");
  SETFILTER("Reservation Status",'<>%1',"Reservation Status"::Prospect);
  IF FIND('-') THEN
    REPEAT
      IF (("Reservation Status" <> "Reservation Status"::Reservation) AND
          ("Expected Receipt Date" <= ToDate) AND
          ("Shipment Date" <= ToDate)) OR
         ((Binding = Binding::"Order-to-Order") AND ("Shipment Date" <= ToDate))
      THEN BEGIN
        ActionMsgEntry.SETRANGE("Reservation Entry","Entry No.");
        DELETE;
        ActionMsgEntry.DELETEALL;
      END;
    UNTIL NEXT = 0;
END;
I am thinking of replacing this find('-') with findset(true, true) since it's doing a delete in the middle of the code, what do you think?

Have anyone experienced performance problems with the planning worksheet or the requisition worksheet and in that case how did you solve it?

Running NAV 2009 SP1 (R2 classic client). It's running on a SQL 2008 SP3 server
Navision developer
Sign In or Register to comment.