We have a site experiencing unacceptable performance when drilling down on GL Accounts. The database is not that large (25 GB) and I'd consider table 17 (4 million entries) rather small. Drilling down on an account with about 200,000 entries can take 20 seconds or longer to open and display. Issue exist with both classic and RTC.
Client sytem details:
NAV 2009 SP1 (build 32416)
SQL 2008
The client server might be considered somewhat light but we've also got a copy of this database on our internal server. It is showing the same behavior. So I don't think hardware is my issue.
Here's the query from profiler:
exec sp_cursorprepexec @p1 output,@p2 output,N'@P1 varchar(20),@P2 varchar(20),@P3 datetime,@P4 int',
N'SELECT * FROM "Production"."dbo"."CompanyName$G_L Entry" WHERE (("G_L Account No_"=@P1)) AND
"G_L Account No_"=@P2 AND "Posting Date"=@P3 AND "Entry No_">=@P4 ORDER BY "G_L Account No_","Posting Date","Entry No_"
OPTION (OPTIMIZE FOR UNKNOWN,FAST 10)',@p5 output,@p6 output,@p7 output,'11100','11100','2004-04-30 00:00:00',7790
select @p1, @p2, @p5, @p6, @p7
Thoughts?
There are no bugs - only undocumented features.
Comments
RIS Plus, LLC
Is there a key for Account number and posting date?
Yes
Is MaintainSQLIndex turned on?
Yes
Has the index been rebuilt recently?
Yes, rebuilt as part of troubleshooting. No noticable difference
Do they have up-to-date stats?
Yes, see above
Any strange looking SQLIndex values?
Not that I've noticed.
Is the drilldown not trying to use a different sort order? Descending order?
No. Both table 17 and form 20 are unmodified.
Is the SourceTablePlacement property set to 'Saved'? Try changing that to 'Last'
Since the form was not modified this was the default of <Saved>. I tried both 'Last' and 'First' with no noticable change.
What's the NAV version? What about SQL Server? Have the latest SP's and hotfixes been applied?
At convergence I did a session with the NAV support guys and they mentioned that there were some specific SQL Server updates that made a huge difference in performance. I'll see if I can get in touch with one of them and ask.
RIS Plus, LLC
I was testing on the client system early this morning with only a few users on. I didn't look explicitly for locks but don't think so. The database on our server I was the only user. So that would not be a locking issue.
The NAV version is 2009 SP1. Neither of the SQL Servers is fully up to date. So I won't rule that out. The client is 10.0.4000.0 which is SQL 2008. The client kept insisting they were running R2. Had to break the news.
Our internal server is 10.50.1600 which is the R2 RTM release.
If you can get any feedback from your NAV support guys, that would be great.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Nope, this is standard (ummodified) table 17 data. I saw your post on that issue when I was searching before posting.
RIS Plus, LLC
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Yes, but table 17 doesn't have any.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
got that. Thanks for the heads up for the future.
In some - actually many - cases it is feasible to set the "Clustered" on the second "Key" ("G/L Account No.", "Posting Date"), as then the physical order of the records matches better to most of the NAV queries ...
Could this help?
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
It is still the default "Entry No.".
I can see this if we were talking about a much larger table. But this is tiny. Less then 4 million records. But anyways I'll give this a try in my test copy. Just to see if it does make a difference.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
from original post:
Since I'm able to easily duplicate this behavior on our internal somewhat larger server, I'm not focused on hardware as the major issue. This is a site that was recently upgraded for 5.0 SP1. The old system does not have this issue.
Just for the record, the production server is a virtual server with dedicated physical disk for the database.
The server on which I am testing:
CPU: 2 quad core 2.00 GHZ Xeon
RAM: 16 GB
Data Disk: 10x RAID 10
Log disk: 6x RAID 10
I'd consider this more then adequate for a 25 GB database.
I went ahead and tested the clustered index change. The result was about a 20% increase in speed. 16 seconds vs. 20 seconds to open the test account. Still considerably slow but maybe part of the solution. I'll see what MS comes back with.
RIS Plus, LLC
Thanks. One of the things I checked. Looking to see if SQL was running off and using some weird index.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
yup.
The one thing I haven't had a chance to do yet is the SQL updates. I'm going to revisit this once I've had a change to get those in.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I'm assuming this is 64 bit OS and 64 bit sql?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Simple example:
If you do an index defrag, an update of the stats is needed.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
'Column statistics' are never updated when rebuilding an index.
I think I may have found the issue. I generally tend to doublecheck things that clients tell me. I had checked the server and sure enough it had the 16 GB of memory the client said was installed. However what I didn't notice at the time was that someone had set SQL maximum memory to 3 GB. When I brought this to the cleint's attention they were surprised it was set like that and raised it. Now the drilldown is much faster. About 5 seconds on something that was taking 20. Not blindign fast but an improvement where it becomes much more usable.
I'll keep an eye on it and see how it settles in.