QUERY PLAN
Sort (cost=13.30..13.31 rows=7 width=21)
Sort Key: u.name
-> Group (cost=13.14..13.20 rows=7 width=21)
Group Key: s.id, u.id
-> Sort (cost=13.14..13.16 rows=7 width=21)
Sort Key: s.id, u.id
-> Hash Join (cost=8.11..13.05 rows=7 width=21)
Hash Cond: (s.accessible_user = u.id)
-> Seq Scan on tbl_visible_calendars s (cost=0.00..4.85 rows=32 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)