Saturday, May 5, 2007

SQL indexes rebuilt For Navision/MS Dynamics NAV

During the implementation of MS Dynmics NAV with the SQL server option, for the better performance of the system, the indexes needs to be rebuilt for the MS Dynamics NAV(Formerly known as Navision) tables. You can use the following SQL Transaction rebuild indexes:

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
CREATE UNIQUE CLUSTERED INDEX "CompanyName$TableName$0" ON
"DatabaseName"."dbo"."CompanyName$TableName" ("Field1InPrimaryKey”,”
Field2InPrimaryKey”,…) WITH DROP_EXISTING
CREATE UNIQUE NONCLUSTERED INDEX "$SecondaryKey1" ON "DatabaseName "."dbo"."
CompanyName$TableName" ("Field1InSecondaryKey1","Field2InSecondaryKey1",…) WITH
DROP_EXISTING
CREATE UNIQUE NONCLUSTERED INDEX "$SecondaryKey2" ON "DatabaseName "."dbo"."
CompanyName$TableName" ("Field1InSecondaryKey2","Field2InSecondaryKey2",…) WITH
DROP_EXISTING

IF @@TRANCOUNT > 0
COMMIT TRAN

You must schedule the rebuilt of indexes for a table based on:

- Whether or not records can be deleted or modified in the table.
- Whether or not records are inserted sequentially in the index.
- The number of indexes (keys) in the table.
- The number of records in the table.

This will help you in rebuilding the indexes and provide you a better peformnace of NAV with the SQL server option.

1 comment:

Unknown said...

Nice post very helpful

dbakings