| Sort (cost=942.13..942.27 rows=54 width=88) |
| Sort Key: (COALESCE(sum(r.amount), '0'::numeric)) DESC |
| -> GroupAggregate (cost=939.37..940.58 rows=54 width=88) |
| Group Key: r.created_by, tt.id |
| -> Sort (cost=939.37..939.50 rows=54 width=25) |
| Sort Key: r.created_by, tt.id |
| -> Nested Loop Left Join (cost=0.44..937.81 rows=54 width=25) |
| -> Nested Loop Left Join (cost=0.29..928.31 rows=54 width=13) |
| -> Seq Scan on tbl_reimbursements r (cost=0.00..365.16 rows=54 width=13) |
| Filter: ((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 = ANY ('{1,2,3}'::integer[])) AND (created_by = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[]))) |
| -> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships ttr (cost=0.29..10.42 rows=1 width=8) |
| Index Cond: ((object_id = r.id) AND (term_id = 18)) |
| Filter: (object_type = 7) |
| -> Index Scan using tbl_term_taxonomies_pkey on tbl_term_taxonomies tt (cost=0.15..0.18 rows=1 width=16) |
| Index Cond: (id = ttr.taxonomy_id) |