Add user index on spam logs
What does this MR do?
This is mostly a guess at what's causing the seq scans in #327482 (closed). However, the index on user_id
is required anyways, given that there is a belongs_to
relationship in the model (though no foreign key).
My suspicion is that seq scans are caused by users being deleted, which in turn deletes logs for the given user. Without an index this leads to a seq scan.
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Edited by Andreas Brandl