SQL Rebuild Index vs NAV Client Optimize!!

FCP
Member Posts: 36
Someone told me that doing table Optimization with Navision Client is better than using SQL 2005 Rebuild Index task.
Is this true? :-k I hope not, because the client optimization cannot be Scheduled to night hours
How often should the rebuild index used?
Thanks
Is this true? :-k I hope not, because the client optimization cannot be Scheduled to night hours
How often should the rebuild index used?
Thanks
0
Comments
-
FCP wrote:Someone told me that doing table Optimization with Navision Client is better than using SQL 2005 Rebuild Index task.
Is this true? :-k I hope not, because the client optimization cannot be Scheduled to night hours
How often should the rebuild index used?
Thanks
Not sure the answers to some of th questions posted here, but I do remember starting a post way back on mbsonline.org about Table optimization and If it was necessary? and if so, How Often?
I think the feelings were mixed that there is an actual gain in performance or not. I forgot if it was the reading got faster and the writing got slower or vice versa.
I guess other can chime in on that. I mainly do it for space once in a while. Any here's a post from the Tip's N' Tricks forum about Optimizing from Ara3n, so it possible!:
Optimizing Tables in Job Scheduler
http://www.mibuso.com/forum/viewtopic.php?t=103310 -
The "Table Optimizer" does two things:
1) Delete "Zero" SIFT Entries
2) Rebuild Indexes doing a CREATE INDEX ... WITH DROP_EXISTING
The Standard MP can not delete the SIFT stuff, except if you include e.g. my stored procedure for this: http://www.stryk.info/ssi_delzerosift.zip
The CREATE INDEX thing is actually the hard way to rebuild indexes; while it is running the table is actually offline.
The MP uses the ALTER INDEX command which is a "smoother" way of defragmenting indexes; and with EE you could do it in an ONLINE mode!
The result (restauration of Fillfactors, Defragmentation of Indexes) of both methods is pretty much alike.
Of course, if you really measure the fragementaion usind DBCC SHOWCONTIG you would find differences, maybe the CREATE slightly better; but for the experienced performance it does not matter.
So, I recommend to stick to the MP!
Best regards,
JörgJörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
Jörg
MP = ?Maintenace plan?
Just to be sure I got it right! You're saying to keep a standard Maintenace plan that rebuilds de index, since there's no major performance differences? :?:
Another thing bother's me. My SQL is with Option Full and the log does not stop to grow, this forces me to sometimes put it in SIMPLE and clean the log file. I bet there's better way, please advice me!!
Best regards,
Rui0 -
You can setup an MP
for backing up the log file and then empty it automatically.
Apathy is on the rise but nobody seems to care.0 -
You need to backup the log and then shrink it.0
-
FCP wrote:Jörg
MP = ?Maintenace plan?
Just to be sure I got it right! You're saying to keep a standard Maintenace plan that rebuilds de index, since there's no major performance differences? :?:
Another thing bother's me. My SQL is with Option Full and the log does not stop to grow, this forces me to sometimes put it in SIMPLE and clean the log file. I bet there's better way, please advice me!!
Best regards,
Rui
Before shrinking your log files you should know you acreage log file size. You shouldn’t decrease your log files to a minimum size. Besides rebuilding indexes you periodically delete zero entries in SIFT tables with script supplied by stryk.0 -
ara3n wrote:You need to backup the log and then shrink it.
If you do a daily backup of the log files (or even more frequently), the log file does not become smaller in size, but the space inside the file will be reused.
Log file will automatically expand. This will take time and will take time when people are working.
Constantly shrinking and expanding the log file will cause a lot of defragmentation.....
In a normal working environment the size of the log file should stay aprox. the same, so why shrink it as it later in the day will expand again....
Rgds
BennyRgds
Benny Giebens0 -
FCP wrote:Jörg
MP = ?Maintenace plan?
Just to be sure I got it right! You're saying to keep a standard Maintenace plan that rebuilds de index, since there's no major performance differences? :?:
Another thing bother's me. My SQL is with Option Full and the log does not stop to grow, this forces me to sometimes put it in SIMPLE and clean the log file. I bet there's better way, please advice me!!
Best regards,
Rui
MP: in the maintenance plan on sql2005 you have the option to keep the index online will rebuilding.
LOG file: besides a backup of data you MUST also do a backup of the log file, otherwise the log keeps growing. After a backup the size will not be smaller but the space inside the logfile will be reused!!Rgds
Benny Giebens0 -
ara3n wrote:You need to backup the log and then shrink it.
<edit> I should really read the whole thread before replying, someone had already made the point :oops: </edit>0 -
If your log file has expanded a LOT because you've never done a log backup, you can shrink it to a taarget size, using the DBCC SHRINKFILE command, which has a target size parameter. Go to Books Online for more information and a sample code snippet.0
-
You can shrink it from within the Management Studio/Enterprise Manager as well. However, as mentioned, that should really not be done on a regular basis. The only time that I have done it is after a restore which requires a lot of LOG space (at least 110% of database size I would estimate).There is no data, only bool!0
-
So I should not shrink the log, I got that, but since I have the log growing really fast what solutions do I have? What I'm I doing wrong? Is it the full Option? Is there a way to keep the log size in control? Again please advise.
PS - I've searched the forum and steel I haven't seen an answer that really states what's the best practice, related to Index and Log size.
Waht to do with SQL maintenace for NAV.0 -
If you have full backup option activated you should have make regular backups of log files to truncate log file. His avoids having huge log files.0
-
It depends on what recovery model you are using. If you have it set to 'Full' then the only way to truncate the log is by backing it up. With the 'Simple' recovery model, it truncates the log when the system runs a full backup, and you won't have to maintain the log file. You should get your partner to help you set this up and explain it further. We can all write big articles about this, but the easiest way is to have someone in your office showing it to you.0
-
MP: in the maintenance plan on sql2005 you have the option to keep the index online will rebuilding.
Regarding the TLog size: the optimal size of the TLog is so that it is never necessary to expand it (Log Growth = new Virtual Log = more administartion = slower performance) but should not waste too much of disk space, also.
To grant this it is necessary to truncate the TLog space by frequent backups, and this depends on your backup strategy and available disk space.
The big advantage of TLog backups is, that with them you could restore a system - in case of disaster recovery - until the very last committed transaction! So running the SIMPLE recovery model would be a waste of this big benefit! FULL is the only option for a productive NAV database.
When it comes to rebuilding the indexes, the TLog wil be used more than usual; e.g. if your DB size is 50GB, a normal TLog size could be 3GB. After re-indexing it could be grown to 55 GB!
So assuming the index maintenance is performed one per week - at the weekend - the process could look like this:
- Normal TLog size during week: 3GB
- Friday, 20:00, End Of Business; Full Backup
- Friday, 21:00: Set Recovery Model to SIMPLE
Run Re-Indexing
If necessary SHRINK TLog to 3GB
Set Recovery Model to FULL
- Saturday, 12:00: Full Backup
With SQL Server 2005 Maintenance Plan this all could be perfectly designed, mixing standard tasks with own TSQL tasks etc.!Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
[Topic moved from Navision forum to SQL General forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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