QUERY PLAN
Sort (cost=14.53..14.55 rows=7 width=21)
Sort Key: u.name
-> Group (cost=14.38..14.43 rows=7 width=21)
Group Key: s.id, u.id
-> Sort (cost=14.38..14.40 rows=7 width=21)
Sort Key: s.id, u.id
-> Hash Join (cost=8.11..14.28 rows=7 width=21)
Hash Cond: (s.accessible_user = u.id)
-> Seq Scan on tbl_visible_schedules s (cost=0.00..6.09 rows=31 width=8)
Filter: ((accessible_user IS NOT NULL) AND (user_id = 1005))
-> Hash (cost=7.74..7.74 rows=30 width=13)
-> Seq Scan on tbl_users u (cost=0.00..7.74 rows=30 width=13)
Filter: (user_status = '1'::type_global_user_status)