Resolution
To fix the outdated statistics found in the Octopus database, run the SQL script provided in the System Integrity Check against the database. To prevent this warning going forward, statistics should be regenerated once a month, as outlined in our database performance documentation.
Example:
| To resolve these issues, execute the following SQL script:
| -- UPDATE STATISTICS Script
| -- Execute this script to update statistics on affected tables
| -- This will help improve query performance
| UPDATE STATISTICS [dbo].[Channel];
| UPDATE STATISTICS [dbo].[Deployment];
| UPDATE STATISTICS [dbo].[DeploymentHistory];
| UPDATE STATISTICS [dbo].[DeploymentProcess];
| UPDATE STATISTICS [dbo].[DeploymentRelatedMachine];
| UPDATE STATISTICS [dbo].[DeploymentSettings];
| UPDATE STATISTICS [dbo].[Event];
| UPDATE STATISTICS [dbo].[EventRelatedDocument];
| UPDATE STATISTICS [dbo].[Interruption];
| UPDATE STATISTICS [dbo].[NuGetPackage];
| UPDATE STATISTICS [dbo].[Project];
| UPDATE STATISTICS [dbo].[ProjectLibraryVariableSet];
| UPDATE STATISTICS [dbo].[Release];
| UPDATE STATISTICS [dbo].[RunbookRunHistory];
| UPDATE STATISTICS [dbo].[SchemaVersions];
| UPDATE STATISTICS [dbo].[ServerTask];
| UPDATE STATISTICS [dbo].[UserIdentityClaim];
| UPDATE STATISTICS [dbo].[UserSession];
| UPDATE STATISTICS [dbo].[VariableSet];
| -- Alternative: Update statistics with FULLSCAN for more accurate statistics
| -- (Takes longer but provides better statistics)
| -- UPDATE STATISTICS [dbo].[Channel] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[Deployment] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[DeploymentHistory] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[DeploymentProcess] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[DeploymentRelatedMachine] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[DeploymentSettings] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[Event] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[EventRelatedDocument] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[Interruption] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[NuGetPackage] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[Project] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[ProjectLibraryVariableSet] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[Release] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[RunbookRunHistory] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[SchemaVersions] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[ServerTask] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[UserIdentityClaim] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[UserSession] WITH FULLSCAN;
| -- UPDATE STATISTICS [dbo].[VariableSet] WITH FULLSCAN;
Symptom
The System Integrity Check completes with a warning regarding outdated database statistics that could impact the performance of the Octopus instance.
| Warning: Database Statistics Check
01:37:00 Warning | Found 116 table(s) with outdated statistics that may impact query performance.
| Statistics should be updated when:
| • More than 7 days have passed since last update
| • More than 20% of rows have been modified
Scope: when this is the right article
This article applies when:
- You are running a self-hosted Octopus Server instance.
- Your Octopus instance is on v2026.1.3704 or later.
- You run the System Integrity Check and receive a warning about outdated statistics.
- The instance has not been upgraded recently and/or routine maintenance is not being performed on the Octopus database, causing the outdated statistics.
Cause
The System Integrity Check now checks database statistics and reports anything outdated. Octopus database maintenance is performed during server upgrades or as part of a routine maintenance plan. If an Octopus instance is not upgraded regularly and does not have a routine maintenance plan, indexes can become fragmented, and statistics can become outdated. This can cause poor query performance on the Octopus database and impact the user experience in the Octopus UI.
Diagnosis and fix
- Review the output of the System Integrity Check task log.
- Make note of the number of tables with outdated statistics.
- Run one of the two SQL scripts provided in the task log:
- The first option is a standard
UPDATE STATISTICSquery. - The second option includes the
FULLSCANoption, which forces a complete read on the table for more accurate statistics. - The number of tables affected by the query should match what was reported in the System Integrity Check task log.
- Consider implementing a routine maintenance plan on your Octopus database. Recommendations are outlined in our performance documentation.
Verify
Rerun the System Integrity check and verify the outdated statistics warning no longer exists.