N+1 issue in GPG keys list view in Admin Credentials Inventory
In !54429 (merged) we introduced N+1 issue when displaying gpg keys on admin page.
To mitigate this N+1 issue we would have to avoid doing a separate SQL query per each user when checking verified emails - either by using batch loader or by using a class method to filter verified emails.
We tried batch loader approach in the original MR but the potential downside is that this method is used also on other places - specifically in NotificationSetting validation which causes that outdated list of verified_emails might be returned.
The following discussion from !54429 (merged) should be addressed:
-
@jprovaznik started a discussion: (+2 comments) Why are these two
BatchLoader::Executor.clear_current
needed? And do we need it to be called twice?
Edited by Jan Provaznik