I'm helping out a friend with a weird issue.
There customer table is super slow. I wrote a simple findset repeat and update a single field on the customer table from a lookup using a codeunit just to test. as shown:
IF Cust.FINDSET THEN
REPEAT
IF PayTerm.GET(Cust."Payment Terms Code") THEN
BEGIN
Cust.VALIDATE("Payment Method Code", PayTerm."Payment Method Code");
Cust.MODIFY;
END;
Window.UPDATE(1, Cust."No.");
UNTIL Cust.NEXT=0;
We timed the window updates and its easily 1.75-2.25 seconds per update and the process takes hours.
Important stuff
- Customer table 40k records
- Nav 2009sp1
- Other tables respond "with normal speed"
- Sql 2008
32gig mem
logs - striped across 4 drives
db - striped across 8 drives
Sql DB's seperate 4 drives
Same speed with out without other users
Steve
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I found a line of code that was a add-on piece of code which checks user field level permissions. So i commented that out and the process flies.
The issue that it raised is why is testing the windows access control table so slow?
Filters are roleid , userid
When you open the table its not slow, but a simple query runs slow.
***Could "maybe a slow Active Directory" slow down virtual tables?
And if you do that for (each field in) each record, it adds up.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You can cache access rights. Simple implementation looks like:
1. Create single instance codeunit Security Management.
2. Inside the codeunit create a boolean variable IsInited and a function InitCodeunit - copy every data that you need into temporary tables.
3. Transfer all security checks into the codeunit functions.
Nav, T-SQL.