Update 6 for Navision 4.0 SP3: BE CAREFULL
Marije_Brummel
Member, Moderators Design Patterns Posts: 4,262
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.
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
-
Thx, for this warning. For every update/hotfix there should be a separate topic or forum with this kind of info.0
-
So instead of actually addressing the issue, it's another thing to make it behave like C/SIDE...
Is the SIFT issue at least solved?0 -
There is no partnersource link (yet) and no kb article (yet).BlackTiger wrote:Link to PartnerSource?
See my blog to get a link to the page where you can ask for the update... .0 -
-
The link seems broken? I'm unable to find anything using this link nor the knowledge base article no. from your blog (940718)Regards
Peter0 -
pdj wrote:
Been there, done that... 8)Waldo wrote:Meanwhile, you can check my blog for summarized info.
And I have also requested the file, but would just like to get the full specs.
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
. 0 -
I guess they found out they needed bigger warning signs for the default index hinting "feature"...Regards
Peter0 -
It is back on-line and here is the "description" of the index hint change:
:-kThe SQL Server Option for Microsoft Dynamics NAV 4.0 Service Pack 3 does not provide index hints for all queries.
This problem occurs because you have to enable the "index hint" function. By default, it is disabled.Regards
Peter0 -
Yes, so now, with update 6, they turned it ON by default, which will make an even bigger mess.0
-
I took an hour to test it, and put my findings into a blog post here.
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:"The SQL Server Option for Microsoft Dynamics NAV 4.0 Service Pack 3 does not provide index hints for all queries.
This problem occurs because you have to enable the "index hint" function. By default, it is disabled."
I'll try to explain with a very simple peace of code:recCustomer.SETCURRENTKEY("Search Name"); recCustomer.FINDFIRST;Normally, this would produce this SQL statement:SELECT TOP 1 *,DATALENGTH("Picture") FROM "400SP3_NAV_TEST"."dbo"."DEFAULT COMPANY$Customer" WITH (READUNCOMMITTED) ORDER BY "Search Name","No_"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:recCustomer.SETCURRENTKEY("Search Name"); recCustomer.FINDFIRST;
The result is now:SELECT TOP 1 *,DATALENGTH("Picture") FROM "400SP3_NAV_TEST"."dbo"."DEFAULT COMPANY$Customer" WITH (READUNCOMMITTED, INDEX("$1")) ORDER BY "Search Name","No_"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:recCustomer.SETRANGE(City, 'Beerse'); recCustomer.FINDFIRST;
C/SIDE will generate an indexhint anyway:SELECT TOP 1 *,DATALENGTH("Picture") FROM "400SP3_NAV_TEST"."dbo"."DEFAULT COMPANY$Customer" WITH (READUNCOMMITTED, INDEX("DEFAULT COMPANY$Customer$0")) WHERE (("City"=@P1)) ORDER BY "No_"
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!0 -
Great post, just a few comments or suggestions.
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...Waldo wrote: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.
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.Waldo wrote:Why not just create an extra property on key level (like there are a bunch since 4.0SP1) called "Hint Index" (boolean).
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...Regards
Peter0 -
OK I am a little lost now.
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
) Apathy is on the rise but nobody seems to care.0 -
Very valid questions.
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.0 -
You can read on the blog:cnicola wrote:OK I am a little lost now.
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
)
That platform update is "Update 6".Index Hinting in Platform Update for Microsoft Dynamics NAV 4.0 SP3 KB940718
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.By the way, Update 6 also includes a much more urgent issue that fixes a problem where SIFT did not always total correctly.0 -
I know about the SIFT fix and that is why I was waiting for that damn thing also.
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:
). Apathy is on the rise but nobody seems to care.0 -
I think better would be a new command for indexhinting. I can think of times that you wouldn't want indexhinting using a certain SETCURRENTKEY.Waldo wrote: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!
So I would say something like this:RESET; SETCURRENTKEY(....); SETINDEXHINTING(...); // it would be nice to have this one! SETRANGE(...) ....
And of course, the same thing as property on forms, dataports,reports.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
So correct me if i'm wrong: if we update to this version, to preserve exact same behaviour as previous versions, we have to
INSERT INTO [$ndo$dbconfig] VALUES
('IndexHint=No’)
on each installation. Correct?0 -
Good. Or actually, not really, because i wan't to update our development clients, because they crash far too often, and this means we have to update a whole lot of dbs aswell
0 -
And what do we need to do if we want indexhinting for a certain query?mrQQ wrote:So correct me if i'm wrong: if we update to this version, to preserve exact same behaviour as previous versions, we have to
INSERT INTO [$ndo$dbconfig] VALUES
('IndexHint=No’)
on each installation. Correct?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
as this blog entry states:As mentioned earlier, you can disable index hinting for the entire system and then enable it where appropriate for your application.
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?0 -
Just keep reading all the way down, you will see as many as FIVE examples of how to turn it back on.0
-
so does that mean that i have to enter one line IndexHint=No, and then further lines to enable them for special cases..?0
-
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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

