Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REFACTOR: redo DiscourseTagging.filter_allowed_tags #8328

Merged
merged 3 commits into from Nov 12, 2019
Merged

Conversation

nlalonde
Copy link
Member

@nlalonde nlalonde commented Nov 8, 2019

This method had grown into a monster. Its query had bugs
that I couldn't fix, and new features would be hard to add.
Also I don't understand how it all works anymore...
Replace it with common table expressions that can be queried
to generate the results we need, instead of subtracting
results using lots of "NOT IN" clauses.

Fixed are bugs with tag schemas that use combinations of
tag groups, parent tags, and one-tag-per-topic restrictions.
For example: https://meta.discourse.org/t/130991/6

TODO: test performance

This method had grown into a monster. Its query had bugs
that I couldn't fix, and new features would be hard to add.
Also I don't understand how it all works anymore...
Replace it with common table expressions that can be queried
to generate the results we need, instead of subtracting
results using lots of "NOT IN" clauses.

Fixed are bugs with tag schemas that use combinations of
tag groups, parent tags, and one-tag-per-topic restrictions.
For example: https://meta.discourse.org/t/130991/6
@discoursebot
Copy link

You've signed the CLA, nlalonde. Thank you! This pull request is ready for review.

Filtering by tag name in the common table expressions is a huge
performance improvement.
@nlalonde nlalonde marked this pull request as ready for review November 12, 2019 19:27
@nlalonde nlalonde merged commit 7711df4 into master Nov 12, 2019
@nlalonde nlalonde deleted the redo-tag-filter branch November 12, 2019 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants