GroupAggregate (cost=784.31..785.70 rows=69 width=12) |
Group Key: (CASE WHEN tbl_schedules.is_complete THEN 1 WHEN ((NOT tbl_schedules.is_complete) AND (tbl_schedules.end_at < '2025-09-10 17:26:30+08'::timestamp with time zone)) THEN 2 ELSE 0 END) |
-> Sort (cost=784.31..784.48 rows=70 width=8) |
Sort Key: (CASE WHEN tbl_schedules.is_complete THEN 1 WHEN ((NOT tbl_schedules.is_complete) AND (tbl_schedules.end_at < '2025-09-10 17:26:30+08'::timestamp with time zone)) THEN 2 ELSE 0 END) |
-> Bitmap Heap Scan on tbl_schedules (cost=137.25..782.16 rows=70 width=8) |
Recheck Cond: (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5329,5332,5420,5448,5449}'::integer[])) |
Filter: ((is_public = 1) AND (CASE WHEN is_complete THEN 1 WHEN ((NOT is_complete) AND (end_at < '2025-09-10 17:26:30+08'::timestamp with time zone)) THEN 2 ELSE 0 END = ANY ('{0,2}'::integer[]))) |
-> Bitmap Index Scan on tbl_schedules_created_by_idx (cost=0.00..137.23 rows=7133 width=0) |
Index Cond: (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5329,5332,5420,5448,5449}'::integer[])) |