QUERY PLAN
Seq Scan on tbl_calendars c (cost=0.00..1412.33 rows=1 width=20)
Filter: (((start_at IS NOT NULL) OR (end_at IS NOT NULL)) AND (created_by = 5016) AND (((is_public = 1) AND (created_by <> 5016)) OR (created_by = 5016)) AND (((start_at >= '2025-06-01 00:00:00+08'::timestamp with time zone) AND (end_at < '2025-06-30 00:00:00+08'::timestamp with time zone)) OR ((start_at <= '2025-06-01 00:00:00+08'::timestamp with time zone) AND (end_at > '2025-06-01 00:00:00+08'::timestamp with time zone)) OR ((start_at <= '2025-06-30 00:00:00+08'::timestamp with time zone) AND (end_at > '2025-06-30 00:00:00+08'::timestamp with time zone))) AND (created_by = ANY ('{1000,1001,1004,1005,1011,1013,1015,1017,1022,1023,5016,5064,5085,5087,5248,5250,5252,5295,5296,5300,5311,5329,5332,5360,5388,5404,5420,5440,5445,5446}'::integer[])))