QUERY PLAN
Aggregate (cost=8.11..8.12 rows=1 width=8)
-> Sort (cost=8.09..8.09 rows=1 width=65)
Sort Key: s.start_at
-> Hash Join (cost=0.09..8.08 rows=1 width=65)
Hash Cond: (u.id = s.created_by)
-> Seq Scan on tbl_users u (cost=0.00..7.74 rows=65 width=4)
Filter: (department_id = 1)
-> Hash (cost=0.05..0.05 rows=3 width=12)
-> Subquery Scan on s (cost=0.00..0.05 rows=3 width=12)
-> Append (cost=0.00..0.02 rows=3 width=65)
-> Result (cost=0.00..0.00 rows=0 width=307)
One-Time Filter: false
-> Result (cost=0.00..0.02 rows=2 width=65)
-> Append (cost=0.00..0.00 rows=2 width=65)
-> Result (cost=0.00..0.00 rows=0 width=110)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 3" (cost=0.00..0.00 rows=1 width=65)
-> Result (cost=0.00..0.00 rows=0 width=549)
One-Time Filter: false