From 1513c7ed4f6f6b03d1721462c705cc0b3f82f127 Mon Sep 17 00:00:00 2001 From: jsalyers <jsalyers@syncad.com> Date: Tue, 9 Jun 2020 19:31:10 -0400 Subject: [PATCH] [JES] Union all works faster than a union. Tried switching order of the join but that didn't seem to make a difference --- hive/server/common/mutes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hive/server/common/mutes.py b/hive/server/common/mutes.py index 003a64921..538210393 100644 --- a/hive/server/common/mutes.py +++ b/hive/server/common/mutes.py @@ -13,14 +13,14 @@ WITH blacklisted_users AS ( SELECT following, 'my_blacklist' AS source FROM hive_follows WHERE follower = (SELECT id FROM hive_accounts WHERE name = :observer ) AND blacklisted - UNION + UNION ALL SELECT following, 'my_followed_blacklists' AS source FROM hive_follows WHERE follower IN (SELECT following FROM hive_follows WHERE follower = (SELECT id FROM hive_accounts WHERE name = :observer ) AND follow_blacklists) AND blacklisted ) SELECT hive_accounts.name, blacklisted_users.source FROM -hive_accounts JOIN blacklisted_users ON (hive_accounts.id = blacklisted_users.following) +blacklisted_users JOIN hive_accounts ON (hive_accounts.id = blacklisted_users.following) """ def _read_url(url): -- GitLab