SQL Clustered Index Fix v2

Administrator
Member, Moderator, Administrator Posts: 2,506
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.
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.
0
Comments
-
Could you provide some info (or a link) to this SQL Clustered Index problem? I'm not aware of what you speak of.
regards0 -
Sp1 added a new feature to the keys that allowed you to select a differnt key as clustered. The problem is that once they added the feature. All the primary keys which were by default custlered were now unclustered. So there were no clustered keys on any table.0
-
And what I understood about clustered indexes is that SQL puts the records together based on the clustered index. So if you read records in sequence using the clustered index, it should go faster because SQL doesn't have to search in different places of the DB.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Ready for the stupid questions?
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??0 -
Waldo wrote:Ready for the stupid questions?
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??
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.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
The bug was created in SP1 and Sp2 tried to fix it. The fix is this. SP1 had all the keys nonclustered.
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.0 -
Waldo wrote:Nevertheless, I executed kriki's fix, and seems to work fine. Don't experience some performance gain yet though ... .
Nice code, kriki!
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.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Kriki,
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,Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!0 -
GoMaD wrote:My question is: Is the execution plan still in the cach after I rebuild the indexes using the rebuild index task of SQL 2005?
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).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
SQL Clustered Index Fix v2
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions