Rebuilding a database index consists in dropping and re-creating the index. This operation removes fragmentation, and reclaims disk space. It compacts the pages based on the specified fill factor setting (if a fill factor is not specified, the default one is used), and reorders the index rows in contiguous pages.
Rebuild your Sitefinity CMS database indexes is an operation that is external from the Sitefinity CMS application, and must be by running your own custom script via the SQL Server Agent. , You can run the optimization scripts manually, or choose the regularity to do that and schedule a procedure.
NOTE: You should rebuild indexes when the site is not under heavy use, since this can result in timeouts and exceptions for your current web site users. Preferably run the script during the night hours or weekends, depending on the business intensive hours. The rebuild times usually should last less than 10 minutes, but depends on the database size. The index rebuild is atomic operation that is not considered a data corruption threat.
When you create or rebuild an index, you can specify a fill factor, which is the amount the data pages in the index that are filled. A fill factor of 100 means that each index page is 100% full.
RECOMMENDATION: To avoid fragmentation of the index each time a new record is inserted in the database and needs to be put between existing records, we recommend to specify a fill factor lower than 100%.
If you run the rebuild scripts on a regular basis and your application is not updated heavily with new data, you can use a fill factor of 90%. This should leave enough empty space on the database index pages for new records until the next rebuild. In addition, not too much empty space on the hard drive will be left unused.
The following sections demonstrate how you get report of the current database fragmentation and then rebuild the indexes.
You can use this report to adjust how often you need to run the indexes rebuild operation, depending on how often and how much your website data is changed (added, updated, deleted).
A couple of points to consider:
Run the following script to get statistics and report of the current database fragmentation:
Run the following script to go over all the Sitefinity CMS database indexes and rebuild them with fill factor of 90%:
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important