SQL Clustered Index Fix
With this little tool, you can fix the clustered index-problem on SQL directly from Navision. As an extra, you can also do some maintenance on the indexes of SQL. It is possible to change the following properties of the indexes in Navision: “Clustered”, ”Enabled”, ”MaintainSQLIndex”, ”MaintainSIFTIndex”. Remember that the fields Date, Time or Modified fields of the object will be changed!
To be used only on a SQL-database of versions 4.0SP1, 4.0SP2. (I don’t know about future versions…)
http://www.mibuso.com/dlinfo.asp?FileID=594
Discuss this download here.
Comments
regards
Bell Business Solutions
Calgary, NB, CANADA
darren.bezzant@bell.ca
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I have a Database with:
In Navision: every index is not clustered. If i open any key (primary or secondary), the property of the key "Clustered" = <No>
In SQL Server: the same key (index), property of the (primary) key "Create as clustered" is "Yes".
How is this possible??
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
This means Navision stores the clustered property somewhere in the table-object and doesn't read it from the SQL-table.
So I think Navision creates it in SQL (and not always) but not always in Navision.
In short: I think there is some random bug on the loose.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
In Sp2 by default PK is clustered. Even if non of the keys in Navision have the field checked. Once you chage the Clustered property in Navision, then SQL is changed.
That's what I've found out from experience.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Nice code, kriki!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Sometimes another clustered key can be better.
E.g. in the entry-tables by using the index that is used for showing the entries on drilldown or in case some flowfield is working on them and you disabled the SIFTIndex.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
a quick question before I deploy the weekly rebuild at one of our customers.
I was always told that you have to "warm up" a sql database by performing a database test. (Which loads the execution plan of all the indexes into the cache of the SQL Server)
At our customer this alone takes about 1 full day.
My question is: Is the execution plan still in the cach after I rebuild the indexes using the rebuild index task of SQL 2005?
Regards,
...
Everybody on-line.
...
Looking good!
But if we reason logically about it, I would say it is not anymore because rebuilding the indexes is like doing a reset. So the execution plans are outdated. Or it must be that SQL changes them on the fly, but I have doubts about that.
For the rest : I think that doing a DBtest for warmup doesn't load the currently used data in memory, but ALL of it (or at least it tries to as far as the SQLmemory can contain the DBdata).
So I think it is best to create a codeunit that reads some frequently used tables in memory (setup-tables,T36,T37,T15,... but NOT the entry-tables).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
With this little tool, you can fix the clustered index-problem on SQL directly from Navision. As an extra, you can also do some maintenance on the indexes of SQL. It is possible to change the following properties of the indexes in Navision: “Clustered”, ”Enabled”, ”MaintainSQLIndex”, ”MaintainSIFTIndex”. Remember that the fields Date, Time or Modified fields of the object will be changed!
To be used only on a SQL-database of versions 4.0SP1, 4.0SP2. (I don’t know about future versions…)
Version 2:
- Added column "No. of records"
- Added field on top to filter
http://www.mibuso.com/dlinfo.asp?FileID=594
Discuss this download here.