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.

  1. ilObjUserTracking::_deleteUser() executes:
    DELETE FROM ut_lp_marks WHERE usr_id = ?
    The table ut_lp_marks has a composite PRIMARY KEY (obj_id, usr_id), but no single-column index on usr_id. Since usr_id is not the leading column in the primary key, MySQL cannot efficiently use this index for queries filtering only on usr_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