Large Dynamics NAV databases (lots of Gigabytes of physical space on disk) needs optimization and tuning at a level that can't be done via the standard NAV interface: you've to work directly on SQL Server.
The first level of optimization starts when your database borns I think. You've to carefully design the physical structure of the DB and always split it on different data files, normally located on different disks.
The second step on optimization regards index defragmentation and tuning (I've written in the past something about it).
But what about when you have really large tables to query? NAV is not always so "speedy" on really large volumes (do you remember the SELECT * question that I hate?
).
An interesting way to optimize performances when you have really large tables on your NAV database is using the SQL Server Table Partitioning feature.
Table Partitioning permits you to horizontally split data on a table based on a certain criteria you want and so having queries optimized (less data and on different physical discs with different performances).
How to implement Table Partitioning on your Dynamics NAV database? If you want a non T-SQL way, I recommend to install SQL Server Management Studio 2008. These are the steps:
Open your Dynamics NAV database with Management Studio and select the table you want to partition (for this sample I've selected the Purchase Line table). Right click on it and select Storage --> Create Partitions:
A wonderful Create Partition Wizard will start...
You've to select the table column on whick you want to create a partition. I've decided to horizontally partition the Purchase Line table for the Expected Receipt Date field (partition by date):
Next, you've to provide the name for your newly created Partition Function:
and for the new Partition Schema:
Next, you've to setup the Boundary of your partition. By clicking the Set Boundaries button you can choose the starting and ending date for your boundaries (<=) and you can choose the Date Range:
This creates the partition ranges by date (on my sample, partitions by years from 01/04/2000 to 01/02/2008).
Next (extremely important) you've to choose the File Group on which you want to place each partition:
This choice must be done with intelligence and it's based on the performance you want to obtain. For example, on my sample I've chosed a partition of the Purchase Line table by date. I suppose that the major number of queries will be done on the most recent records, so it could be a good choice to place the most recent partitions by date (ex. from 2004 to the last) on the top performant disks (physical filegroups) and viceversa the oldest data (rarely queried) on the less performant filegroup.
If you click on the Estimate Storage button you can have also a detail of the required disk space for each partition:
On the last wizard's step you can choose the Output option (if you want to create a script or if you want to launch the partition process immediately):
That's all... simple with this new wizard, isn't it?
Dynamics NAV has lots of tables that on large companies could grow a lot (G/L Entry, Item Ledger Entry, FA Ledger Entry for example...) and this is an optimization trick that you've to evaluate in order to tune up your database.