mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
this join is brutal, hardcoding user id is way more efficient, but in pg
This commit is contained in:
parent
3b61b098ab
commit
2847ec0af1
1 changed files with 1 additions and 1 deletions
|
@ -151,7 +151,7 @@ class TopicTrackingState
|
||||||
( category_id IS NULL OR NOT c.read_restricted OR u.admin OR category_id IN (
|
( category_id IS NULL OR NOT c.read_restricted OR u.admin OR category_id IN (
|
||||||
SELECT c2.id FROM categories c2
|
SELECT c2.id FROM categories c2
|
||||||
JOIN category_groups cg ON cg.category_id = c2.id
|
JOIN category_groups cg ON cg.category_id = c2.id
|
||||||
JOIN group_users gu ON gu.user_id = u.id AND cg.group_id = gu.group_id
|
JOIN group_users gu ON gu.user_id = :user_id AND cg.group_id = gu.group_id
|
||||||
WHERE c2.read_restricted )
|
WHERE c2.read_restricted )
|
||||||
)
|
)
|
||||||
AND NOT EXISTS( SELECT 1 FROM category_users cu
|
AND NOT EXISTS( SELECT 1 FROM category_users cu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue