QUERY PLAN
GroupAggregate (cost=41.88..41.91 rows=1 width=55)
Group Key: dt1.taxonomy_id, t1.name
-> Sort (cost=41.88..41.89 rows=1 width=51)
Sort Key: dt1.taxonomy_id, t1.name
-> Nested Loop Left Join (cost=8.33..41.87 rows=1 width=51)
-> Nested Loop Left Join (cost=8.18..33.69 rows=1 width=51)
-> Seq Scan on tbl_reimbursements r (cost=0.00..21.28 rows=1 width=44)
Filter: ((status <> 0) AND (created_by = ANY ('{5493,5495}'::integer[])) AND (occurrence_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (occurrence_at <= '2026-12-31 23:59:59+08'::timestamp with time zone) AND ((status = '1'::smallint) OR (status = '2'::smallint) OR (status = '3'::smallint)))
-> Hash Right Join (cost=8.18..12.41 rows=1 width=19)
Hash Cond: (t1.id = dt1.taxonomy_id)
-> Seq Scan on tbl_term_taxonomies t1 (cost=0.00..3.61 rows=161 width=15)
-> Hash (cost=8.17..8.17 rows=1 width=8)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.15..8.17 rows=1 width=8)
Index Cond: ((object_id = r.id) AND (term_id = 15))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt2 (cost=0.15..8.17 rows=1 width=8)
Index Cond: ((object_id = r.id) AND (term_id = 18))
Filter: (object_type = 7)