This week Microsoft released update 6 for Navision 4.0 SP3. Mainly a lot of SQL fixes, or so they say.
At first I thought that it was a combination of update 1, 4 & 5 but that seems not to be the case.
What they seem to have done is enable indexhints out of the box. This was already possible in older versions but it was by default disabled.
Be aware that installing this update without profesional help can lead to very unexpected behaviour.
It is indeed true that you can work around the SQL2005 bug with an index hint. But in the cases I have seen it usualy takes 4 or 5 to make the system work. The Microsoft solution can be a "little" overkill.
The update comes without documentation but there is some. Please contact your local Microsoft hub or SQL Perform for more information.
Still we need to put as much preasure as possible on Microsoft to keep working on better SQL support.
0
Comments
Is the SIFT issue at least solved?
RIS Plus, LLC
See my blog to get a link to the page where you can ask for the update... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Here is the link.
Peter
Meanwhile, you can check my blog for summarized info.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
And I have also requested the file, but would just like to get the full specs.
Peter
Is very strange indeed. I got my info from those full specs ... and now I can't reach it anymore. Let's wait and see .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Peter
Well ... if that is the case .. I'm looking forward to hear their statements .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
:-k
Peter
RIS Plus, LLC
Here is the text:
Review:
One of the discussed new features in update 6 is the fact that the new client (build 24143), is creating indexhints by default. The official hotfix article (which you can find here) doesn't explain much:
I'll try to explain with a very simple peace of code: Normally, this would produce this SQL statement:
Sometimes, when NAV won't take the right key, you have some options to change this. One of these options (some kind of last resort) was index hinting. I explained this in a previous blogpost. You can find it here.
Now, in 4.0 SP3 update 6, index hinting is enable by default. What does this mean? Let's take the same query:
The result is now: It adds the indexhint in the SQL query by default. What does this mean? Well, I'm not a SQL junky like some others in the community, but this is what I think it means: Sometimes, it's better to take another index than the one you're ordering your data. In SQL , you just don't create indexes for sorting. Just for retrieving data. Now, SQL will not have a choice … it IS going to take that same index, whether there is a better one for that specific query or not.
By the way … this is naughty. Suppose even a more simple peace of code:
C/SIDE will generate an indexhint anyway:
So, even though no sorting is specified … it IS going to create an indexhint. Based on the clustered key? NO!! Based on the primary key. Suppose you change the clustered key to another one (I took "Search Name"), it will still hint the same key.
I have been looking for a property on SQL Level and on C/SIDE level to be able to find a switch to turn it off, but nothing to find:
In the "Alter Database" window
In table "$ndo$dbproperty"
In table "$ndo$dbconfig" (I couldn't even find this table, so it's working in a whole other way then before (again, see my previous post here))
In properties on table level
In properties on field level
In properties on key level
Suggestion:
I have a suggestion.
Why not KISS ? C/SIDE, Navision, … it has always been about keeping it simple.
Why not just create an extra property on key level (like there are a bunch since 4.0SP1) called "Hint Index" (boolean). Then, you would have these SQL properties on key level:
Clustered
MaintainSQLIndex
MaintainSIFTIndex
SIFTLevelsToMaintain
Clustered
SQLIndex
Hint SQLIndex
Only when the boolean is true … generate the indexhint. Very simple, very straight forward, very NAV. In the next phase, the default NAV database could be set up that was that most scenario's work (like the way the other properties have been set up since version 5.0 ).
Only a suggestion. Probably others will have better suggestions. Please post'm all!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Well, since the code has to work the same for Native and SQL it has to assume you want to have it sorted by primary key in this example. That makes it ok, or atleast consistant...
I don't think it would be a good idea to make it a boolean. That assumes the index is maintained on SQL. I have several keys just for form and report sorting that isn't maintained by SQL. For these keys I would like to decide which other key it should use. I also have keys that are quite different on the SQL and there I might want a completely different key. So in short I would just like to decide which index (if any) it should index hint.
But all of this shouldn't be nessesary - SQL2005 should be clever enough to find the right indexes to use. SQL2000 was pretty good at it...
Peter
Well, I absolutely agree. It is not as easy, but it is definitally more flexible... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I have a feeling that the author is part of the design team, so I hope I deserve a break .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
The title of this thread is related to Update 6.
But reading the MS blog that waldo linked, it does not mention just update 6.
So :
1. This index hinting thing is only active by default for Update 6?
2. Since now we have 5.0 already, is index hinting on by default in 5.0 as well? I don't think so since I don't recall seeing the index hint in Profiler.
But then why add this rather distinct functionality to only one minor version of Navision? ](*,) (getting a headache already
)
1: yes, it was put in place in update 6 as a "fix" for a little bug (with big consequences) that SQL Server was using a cached index for wrong purposes. We've been able to address the problem by turning on the index hint for just the ones that had the issue, and now MS has turned it on by default for all queries. The problem is that it simulates NAV behavior on SQL Server, and that is not really the right way to approach this in my opinion. It forces SQL Server to use certain indexes for certain queries, and it takes away some of SQL Server's very efficient query optimizer.
It's not really a big problem though, because we have the option to turn it back off, as shown in the blog. It's also really too early to tell if my skepticism is founded, but I've already heard a customer say that their database slowed down after installing update 6 on a test box.
2: no, this has not been "fixed" for 5.0 yet, because the problems came to light after 5.0 was already released. I have not seen or heard anything official from Microsoft, but I would assume that they are working on an update for the same issues in 5.0
By the way, Update 6 also includes a much more urgent issue that fixes a problem where SIFT did not always total correctly.
RIS Plus, LLC
This is actually the reason why you "should" install it ... and that's why I was looking for a way to get rid of the indexhinting.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
However after 2 months of SQL tuning I am a little reluctant to install something that may require me to revisit all that work.
I know, I know I can just disable index tuning but frankly all this SQL tuning fun gets old after a while ](*,) (especially when you are a consultant and not their internal resource. Try having 3 clients on SQL all with huge transactions volumes and keep all of them straight :sick: ).
Anyway enough ranting. Another dumb question: does 5.00 as it stands now have the SP3 (prior to update 6) issue with SIFT? (I am sure you see where I am going with this :oops: ).
So I would say something like this:
And of course, the same thing as property on forms, dataports,reports.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
INSERT INTO [$ndo$dbconfig] VALUES
('IndexHint=No’)
on each installation. Correct?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
but then it fails to give an example of how to do it..:(
oh, and it seems this update wants to convert sql db to new version, so it won't be opened with pre-update client, correct?
RIS Plus, LLC
RIS Plus, LLC