QUERY PLAN
GroupAggregate (cost=226.66..226.69 rows=2 width=40)
Group Key: (to_char(r.created_at, 'YYYY-MM'::text))
-> Sort (cost=226.66..226.66 rows=2 width=36)
Sort Key: (to_char(r.created_at, 'YYYY-MM'::text))
-> Nested Loop Left Join (cost=0.29..226.65 rows=2 width=36)
-> Seq Scan on tbl_approves r (cost=0.00..210.00 rows=2 width=20)
Filter: ((status <> 0) AND (created_at >= '2025-01-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = '1'::smallint) AND (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[])))
-> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.31 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))