Skip to content

Reduce number of SQL queries in UserReferenceFilter

yorickpeterse-staging requested to merge banzai-user-filter-queries into master

What does this MR do?

This MR reduces the number of SQL queries needed to build HTML containing username references.

Are there points in the code the reviewer needs to double check?

Of course not.

Why was this MR needed?

In the current master branch this filter will run a SQL query for every username mentioned in a comment. On a page with many comments that need to be rendered (e.g. the cache expired) and that mention a lot of usernames this can have quite a severe impact on the loading time.

Merge request reports