There are a few key performance troubleshooting
techniques that are effective in identifying the bottlenecks in the
performance of the database.
Updating statistics
There are several tools
available from various Microsoft Dynamics ISV(s) that provide effective
tools for monitoring the performance of a Dynamics NAV database.
The Index Defrag tool
The Index Defrag
tool is a Dynamics NAV tool that comes along with the Microsoft
Dynamics NAV SQL Resource Kit, and helps in identification of the keys
that need to be defragmented:
1. Look for the index defrag tool.fob file in the Dynamics NAV SQL resource toolkit. Import the object file into the database and run the 50090 form, Index Defrag Card.
2. Start with filling the setup form from the Defrag menu in the bottom as shown in the following screenshot:
3.
Once we have set up and tested the connection to the SQL Server, the
next step is to specify the file locations for the scripts that this
tool would generate. Specify that in the File Locations Card.
4. On the Execute tab on the File Locations form, specify the isqlw.exe filename and the path of the file for the SQL Server, if it is not on the same machine.
5. The tool runs DBCC ShowContig in the background when we click on the Process button on the form, and gathers information about various indexes and also more information about fragmented indexes.
6. We can also view the recommendations made by the tool and the suggested indexes for defrag or rebuild. Click on the Recommend button at the bottom of the form and click Generate on that form to see a list of indexes. Additional check marks can be placed on the rightmost columns for Index Defrag and Database ReIndex. The ones that are check marked already are the recommendations by the tool. Use the functions listed in the Recommend menu button at the bottom to execute the SQL queries generated in the process.
7. The tool also creates the SQL scripts and stores them in the specified folders.
It is worth noting that
a defrag will try to reorganize the index more effectively, and the
rebuild just drops the index completely and rebuilds it from scratch.
The Key Information tool
Use the Key Information Tool.fob to use the Key Information tool and gather additional information about various keys in the tables of the database as follows:
1. Run the form 50070, Key Information. The initial server setup is similar to the Index Defrag tool mentioned earlier. Also, it can be accessed from the menu button Key info | Setup SQL Connection.
2.
An additional setup needs to be done to specify what percentage of
empty SIFT(s) and key fields is the threshold for the tool to change the
color of the data. This can be accessed from Key Info | Key Information Setup. The default values are 80 percent.
3. Export the tables from the database (as a .txt file) and provide the path of the .txt file by clicking the Load Text Objects option at the bottom of the form.
4. The tool now reads all the key information from tables and presents that in an easily navigated format.
5.
To investigate a particular table, scroll left or right to the
appropriate table and select a key that we want to know about. In the
following example, we are looking at the Item Ledger Entry table and the following key: Item No.,Open,Variant Code,Positive,Location Code,Posting Date,Expiration Date,Lot No.,Serial No. 13. SIFT levels are enabled for this key and we can scroll down to see the SIFT levels.
It is worth noting that
Date and Text types in SIFT are not recommended due to the way the
bucket tables are created and can cause performance issues and large
bucket tables.
Session Monitor
The Session Monitor
tool for Dynamics NAV Classic database server and for Dynamics NAV SQL
database can be used to find out which sessions/users are causing the
locks/blocks, to monitor I/O CPU usage, and many more.
Optimizing tables from the Dynamics NAV interface
The Dynamics NAV client for SQL Server provides an optimization tool that can be used to optimize tables.
For each table in Dynamics
NAV, all SQL indexes, except the primary key, are rebuilt using the
following SQL statement (this gets executed in the background when we
click Optimize):
CREATE …. INDEX …. WITH DROP_EXISTING
To use the "optimize" feature in Dynamics NAV, follow these steps:
1. Go to File | Database | Information.
2. In the Database Information window, highlight the table(s) that we need to optimize, and click on the Optimize button at the bottom of the form as shown in the following screenshot:
3. A progress bar takes us through the entire optimization process for the selected tables.
The main advantages of
optimizing the tables include improved performance as a result of
improved layout and defragmentation of indexes. It is also to be noted
that SIFT index views are cleared of any zero values to free up
additional space and improve SIFT performance.