When a SonarQube instance contains a lot of issues, deleting a project from the UI can be slow and requires a lot of CPU.
The CE DB purge step and the deletion of projects from UI trigger full scans of issue_changes. That leads to high pressure on DB and to the inability to process the Compute Engine queue.
One option would be to:
- add the column issue_changes.project_uuid so that the purge SQL request can be filtered and stop full scanning the table.
Another one, specific to PostgresSQL :
- add a foreign key from issue_changes.issue_key to issues.kee so that the PostgreSQL feature "on delete cascade" can be implemented on issues.
- Store issue_changes as json inside the issues table, and drop the issue_changes table.