No index:
CTE Scan on flat_members (cost=10145.57..10147.59 rows=101 width=8) (actual time=3.321..26.953 rows=3 loops=1)
CTE flat_members
-> Recursive Union (cost=0.00..10145.57 rows=101 width=8) (actual time=3.319..26.947 rows=3 loops=1)
-> Seq Scan on subject_group_members gm (cost=0.00..866.77 rows=1 width=8) (actual time=3.315..4.825 rows=2 loops=1)
Filter: (subject_id = 30459)
Rows Removed by Filter: 48380
-> Hash Join (cost=0.33..927.68 rows=10 width=8) (actual time=10.937..11.043 rows=0 loops=2)
Hash Cond: (s.subject_id = f.subject_group_id)