The previous query which uses a subquery in combination with the OR condition results in the PG planner unable to leverage the indexes we have available. Instead, the PG planner would loop through each user record and execute the subquery once per row. As the number of users on a site increases, this query becomes more and more expensive to run leading to the query timing out once a certain threshold is reached. In the new query, we remove the OR condition which allows the PG planner to the existing indexes more effectively. We also improved the subquery by removing an unnecessary join against the groups table. Since `group_users` rows are cleaned up when a group is destroyed so there is no need for the inner join on the `groups` table. |
||
---|---|---|
.github/workflows | ||
app | ||
assets | ||
config | ||
db | ||
jobs | ||
lib | ||
spec | ||
svg-icons | ||
test/javascripts | ||
.discourse-compatibility | ||
.eslintrc | ||
.gitignore | ||
.prettierrc | ||
.rubocop.yml | ||
.template-lintrc.js | ||
Gemfile | ||
Gemfile.lock | ||
README.md | ||
package.json | ||
plugin.rb | ||
translator.yml | ||
yarn.lock |
README.md
Assign Plugin
Allows you to assign topics and individual posts (both private and public) to a user or group.
For more information, please see: https://meta.discourse.org/t/discourse-assign/58044