Skip to content

Conversation

@fhelfer
Copy link
Contributor

@fhelfer fhelfer commented Jan 22, 2026

Performance Optimization: Add Single-Column Indexes for User Deletion Queries

The user deletion process (ilObjUser::delete()) exhibits performance issues, particularly when deleting users with extensive learning progress. Analysis of the deletion flow reveals that critical DELETE queries are executed without optimal index support.

Dashboard settings cleanup (in ilBlockSetting::_deleteSettingsOfUser()) executes:

DELETE FROM il_block_setting WHERE user_id = ?

The table il_block_setting has a composite PRIMARY KEY (obj_id, user_id), but no single-column index on user_id. Since user_id is not the leading column in the primary key, MySQL cannot efficiently use this index for queries filtering only on user_id, resulting in inefficient table scans or range scans over the clustered index.

Related to https://mantis.ilias.de/view.php?id=31664

@fhelfer fhelfer added improvement php Pull requests that update Php code labels Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants