Skip to content
Snippets Groups Projects
Commit 1513c7ed authored by Jason Salyers's avatar Jason Salyers
Browse files

[JES] Union all works faster than a union. Tried switching order of the join...

[JES] Union all works faster than a union. Tried switching order of the join but that didn't seem to make a difference
parent 247a61f9
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment