QUERY PLAN
Group (cost=16.62..16.63 rows=1 width=4)
Group Key: u.id
-> Sort (cost=16.62..16.62 rows=1 width=4)
Sort Key: u.id
-> Nested Loop (cost=0.43..16.61 rows=1 width=4)
-> Index Scan using tbl_punch_pkey on tbl_punch p (cost=0.29..8.31 rows=1 width=4)
Index Cond: ((day_at >= '2026-07-01'::date) AND (day_at <= '2026-07-01'::date))
Filter: ((in_at IS NOT NULL) OR (out_at IS NOT NULL))
-> Index Scan using tbl_users_pkey on tbl_users u (cost=0.14..8.16 rows=1 width=4)
Index Cond: (id = p.user_id)
Filter: (user_status = '-1'::type_global_user_status)