Waldo once posted an idea for using a report or codeunit to rebuild SIFT indexes. It was something along the line of:
Using the virtual KEY table uncheck the "MaintainSIFTIndex" option, modify, check it again, modify. You now have a completely clean SIFT table free of zeros, fragmentation etc etc.
The main issue however is that if you have anyone logged in they get the "Another user has modified the definition....." error when they use this table. Alas for me we have 30 users that need to be logged in constantly and run schedulers etc. This means restarting all 30 if this procedure is done.
However rebuilding the SIFT tables on even a small but busy table (sales line table) has improved one of my scheduled jobs from 4 hours to 15 minutes. A massive improvement. (Only one of our keys on that table has sift indexes with only two of its levels activated but its the key thats used when you do Item.CALCFIELDS("Qty. On Sales Order"))
So the question is, how to periodically, maybe weekly or monthly, cause a rebuild of such tables but without triggering the definition modification error?[/quote]
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
If you have optimized your "Buckets" (see http://dynamicsuser.net/blogs/stryk/archive/2007/10/28/included-columns-vs-sift-tables.aspx) this fiddling with the flag will reset to default - insufficient - settings ](*,)
To maintain the SIFT table you should run a weekly cleanup, e.g. using this procedure http://www.mibuso.com/dlinfo.asp?FileID=812
and peridically rebuild all indexes, e.g. using the SQL Maintenance Plan!
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
The object has always, so far in my experience, remembered the SIFT bucket settings after playing with this setting on the object. Nothing has ever returned to default on me.
I assume you are referring then to the covering indexes that you recommend on the SQL server side. I do not, at present, have any of these.
If you re-open the table object again to set "MaintainSIFTIndex" to TRUE, then the SIFT buckets are enabled by default - wrong - settings.
At least this happens when you do that directly in "Object Designer"; haven't tested that when doing it via C/AL in the "Key" table, I guess the results will be the same ... maybe you could test ...
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
The post where Mauddib is talking about is this one.
As you can see, I did warn about the SIFT levels, as Jörg also did.
I took the libery to test this myself. This is my first codeunit (Please, don't comment on the code ... it's midnight at the moment ): No, SETRANGE is not possible on the Key table (at least not in my database).
After running this codeunit, all SIFTs from G/L Entry table are gone... .
After that, I run this code (Second codeunit):
The SIFTs are back ... in the SAME way as they were deleted. Same levels, same buckets, no more, no less!! So I guess Mauddib is right ... (I didn't expect this myself ).
This is a different behaviour then doing this from the object designer, but interesting enough to build some kind of "re-sift-engine" .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
The really weird part.... when you disable a key (directly or from a keygroup), all SIFT definition is removed from the text object file, so there must be some sort of references somewhere else.
RIS Plus, LLC
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Hehehe I actually regretted putting your name in the title after I did it. I realise your original post was more of a "thinking out loud" and my title here suggested it was somethign you were putting your name to as a definite course of action. Sorry if I caused any iritation
Hehehehe my knowledge in Navision may be much more limited than you and Herr Stryk. But I do have a rule "dont say anything until you are sure you are correct"
It is. But alas not for me unless I find some way around the "Another user has modified the definition....." error.... which alas doesnt look likely.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
8)
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Very good info. Thx.