(imported topic written by SystemAdmin)
I’ve been looking into database re-indexing lately and have come up with some optimizations we can make. I’ll attach to SQL scripts that will create new maintenance plans for the BFEnterprise database.
-
Weekly Full Database Reindex 6_0.sql - Adds a weekly maintenance job that re-indexes all the database tables except the QUESTIONRESULTS, ACTIONRESULTS and FIXLETRESULTS tables. The job runs on Saturday at 11pm and shouldn’t take more than a minute or two to complete. Fragmentation in these tables shouldn’t cause performance problems but it couldn’t hurt to keep these tables optimized and reduce disk space caused by fragmentation, the TEXTFIELDS table in particular can be quite large and fragmentation could cause minor slowness. This maintenance task will only work correctly in BES 6.0.
-
Daily Results Reindex.sql - Creates 3 maintenance jobs, each re-indexes a different RESULTS table. Each job runs four times a day but I’ve spread them apart so one runs every 2 hours. Normally, all three tables are re-indexed every 6 hours at the same time and this changes it so that a different table is re-indexed every 2 hours instead. You should disable the current maintenance job, ‘BFEnterprise Results Table Reindexing Job’, before adding these maintenance job. This job should work in all versions of BES up to 7.0.
The scheduling change made by #2 is designed to help in situations where reindexing all 3 tables at the same time takes over 5 minutes together and locking the database for this long is noticeable to users. By spreading out the jobs we minimize the amount of time the database is locked at any given time.