# Pastebin DiPVKjEZ QUERY PLAN ------------------------------------------------------------------------------------------------ CTE Scan on redirects (cost=3382.33..4874.61 rows=59691 width=32) CTE redirects -> Recursive Union (cost=0.00..3382.33 rows=59691 width=32) -> Seq Scan on entity_redirect (cost=0.00..10.91 rows=591 width=32) -> Hash Join (cost=18.30..217.76 rows=5910 width=32) Hash Cond: (rd.target_bbid = er.source_bbid) -> WorkTable Scan on redirects rd (cost=0.00..118.20 rows=5910 width=16) -> Hash (cost=10.91..10.91 rows=591 width=32) -> Seq Scan on entity_redirect er (cost=0.00..10.91 rows=591 width=32)