Hello,
I have a procedure that takes on Navision native DB about 1 Minute but on SQL-Server more than 2 hours :roll: .
What takes the most of the time is a setrange() command on a flowfield.
This flowfield calculates its value from another table. On this (other/foreign) table I just created an index so that it should speed up, but it's not

Navision shows a dialog that the (foreign) table is searched (with a speed of 10 datasets per second ](*,) ).
So what can I do ?
Thanks.
Comments
1. Use a SETCURRENTKEY statement on the main table.
2. Use SETRANGE/SETFILTER on every field in the SETCURRENTKEY statement. Set them in order and do not skip any fields.
3. Review the flowfilter definitions and the sumindexfields and related keys of the secondary table. Navision will use the first key on the secondary table that has the sumindexfield defined and all field that are being filtered by the flowfilter definition. Adjust the flowfilter and secondary table to control this.
Use the available performance monitoring tools to see what is actually happening and to help you make adjustments.