Running Nav 2.6 on SQL Server 2000. Applications are fast, but then suddenly seem to get stuck on a random basis. Turns out that there is a huge, stray select running and hammering the database.
For example: The user views and Inventory Item, History. They then click on the <Window> menu to switch to another window and the client "hangs". Watching the database activity for the SPID of that session in SQL Profiler shows that a huge select is running. In this case it is a select from Item Ledger Entry for the Item just viewed, but somehow it does not use indexes. It ended up doing 12 000 000 reads and hanging the client session for about 15mins. If I take the same query and run it in Query Analyser, it does 16 Reads and is fast.
In another example we have a header/detail form. If we click on different lines in the detail form, it is fast, but suddenly, clicking on a line causes a killer select to run (which relates to the line which we had selected before). The same thing can happen when moving between fields with the arrow key.
This is completely random and does not relate to the specific data in the field. Moving between 2 fields can be quick for 20 or more clicks and then suddenly it fires off the select. As you can imagine on tables with many rows, a query which does not use the correct index kills the machine and keeps the client session waiting for anything up to 40 minutes.
Very strange! Has anyone seen this before? Thanks
Managing Director
Linc Communications
roger@linc.co.za
MBS Navision Partner
0
Comments
It is possible that SQL decides to use a certain index that he thinks is good based on outdated SQL statistics.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I guess my real questions are:
1. Why does Navision submit a select when you are leaving a field/window - there's no point in getting data when you're moving onto something else and nothing was modified.
2. Why do these queries cause SQL-Server to do so many reads, whereas the same queries run from Query Analyser are optimised. It's almost as though something tells SQL-Server to use the incorrect index.
3. Why does this behaviour occur on a random basis? One can sit on a screen and click between the same field on two different lines of the detail records and then suddenly and randomly the application appears to hang and SQL-Profiler shows a huge query has run. We get this jump from instant response to 10-30min delay.
Thanks
Linc Communications
roger@linc.co.za
MBS Navision Partner
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
(If this problem is fixed by an upgrade then this might be the motivation we've been looking for to get the client to migrate their (highly customised) system to version 4. As an interrim step, we may try and use v4 SP2 client with the current code and see if this fixes the problem.)
Thanks
Linc Communications
roger@linc.co.za
MBS Navision Partner
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.