SonarQube becomes slow after PostgreSQL upgrade

Hello SonarQube Operators!

It’s common that after performing an upgrade of PostgreSQL, a SonarQube instance connected to a PostgreSQL database can become painfully slow.

Thankfully, we know how the issue can usually be addressed (it works almost every time!): by executing the following command against your Postgres database.

VACUUM FULL ANALYZE

For a PostgreSQL database, a VACUUM FULL command reclaims unused storage, while the ANALYZE command updates statistics used by the planner to determine the most efficient way to execute a query (thank you Postgres documentation! :slight_smile: ).

It’s possible that AUTOVACUUM is already enabled for your database which runs these commands at regular intervals. Executing these commands manually can solve the immediate performance issue rather than waiting for the daemon to run.

If you face performance issues after upgrading the version of Postgres used, this should be the first action you take.

Do you still need some help? Raise a topic on Get Help > SonarQube

Colin

6 Likes
Project data loading extremely slow after Postgres upgrade from 9.5.22 to 12.3
Task execution extremely slow after postgres upgrade
Sonarqube Scan increased from seconds to hours after upgrade
Problems updating Sonar Enterprise from 8.1 to 8.9.X
Error in loading global properties in sonar server after an upgrade to postgreSQL11
SonarQube version 8.9LTS stopped loading after PostgresSQL RDS upgraded 11.20v
After upgrading to 9.9, analysis takes a long time
SonarQube upgrade Process (upgrade RDS Postgresql)
SonarQube publishing task is timingout/taking too long to report findings back to Azure DevOps
Splitting SonarQube job in multiple parts
Server side analysis slow after update from v9.9.1 LTS to v10.5.1 (Enterprise)
Background task time different with same project but different instances
SonarQube upgrade from 9.9.3 to 9.9.4 issue with stuck queries
Slow analysis after SonarQube upgrade
Upgrading SonarServer from 9.9.1 to 9.9.6 is very slow the first time server start
Diagnose performance difference between two environments
SonarQube will only run one job per project despite multiple workers
License_usage web api gets timout
SonarQube build analysis hanging when adding coverage report
Quality analysis becomes very slow on the master branch after upgrading to 2025.1
Quality analysis becomes very slow on the master branch after upgrading to 2025.1
SonarQube Timeout and Data Reload Issue After PostgreSQL Upgrade to 15.7
Sonarqube Enterprise upgrade postgres db from v12 to v13
Sonarqube `issues` page loading very slowly after upgrade database
Problems viewing issues and performing pipeline scans plus excessive database usage
Unable to scan after upgrading postgresSql engine version only
PostgresQL DB upgrade with Sonarqube 9.9 failed