Limit (cost=618.12..618.15 rows=10 width=523) |
-> Sort (cost=618.12..618.18 rows=24 width=523) |
Sort Key: s.is_complete, s.end_at DESC, s.created_at DESC |
-> Group (cost=617.36..617.60 rows=24 width=523) |
Group Key: s.id |
-> Sort (cost=617.36..617.42 rows=24 width=519) |
Sort Key: s.id |
-> Hash Left Join (cost=27.57..616.81 rows=24 width=519) |
Hash Cond: (s.id = ccr.schedule_id) |
Filter: ((((s.is_public = 1) AND (s.created_by <> 1000)) OR (s.created_by = 1000) OR (ccr.user_id = 1000)) AND ((s.created_by = ANY ('{1000,1001,1004,1005,1011,1013,1015,1022,1023,5016,5064,5085,5087,5248,5250,5252,5295,5300,5311,5332,5360,5388,5446,5449}'::integer[])) OR (ccr.user_id = 1000))) |
-> Hash Join (cost=8.03..596.90 rows=42 width=519) |
Hash Cond: (s.created_by = u.id) |
-> Seq Scan on tbl_schedules s (cost=0.00..588.11 rows=281 width=519) |
Filter: ((NOT is_complete) AND (end_at < '2025-09-12 17:11:45+08'::timestamp with time zone)) |
-> Hash (cost=7.76..7.76 rows=21 width=4) |
-> Seq Scan on tbl_users u (cost=0.00..7.76 rows=21 width=4) |
Filter: (department_id = 2) |
-> Hash (cost=10.91..10.91 rows=691 width=8) |
-> Seq Scan on tbl_schedule_carbon_copy_rels ccr (cost=0.00..10.91 rows=691 width=8) |