| GroupAggregate (cost=407.15..407.21 rows=3 width=36) |
| Group Key: "*SELECT* 1".id |
| -> Sort (cost=407.15..407.15 rows=3 width=9) |
| Sort Key: "*SELECT* 1".id |
| -> Append (cost=0.29..407.12 rows=3 width=9) |
| -> Subquery Scan on "*SELECT* 1" (cost=0.29..378.64 rows=1 width=9) |
| -> Nested Loop (cost=0.29..378.63 rows=1 width=17) |
| -> Seq Scan on tbl_erp_cash_cost_tickets r (cost=0.00..366.69 rows=1 width=4) |
| Filter: (is_payment_settle AND (bank_settle_at >= '2026-06-01 00:00:00+08'::timestamp with time zone) AND (bank_settle_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (bank_settle_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (bank_settle_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (status = 2)) |
| -> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt (cost=0.29..11.93 rows=1 width=13) |
| Index Cond: ((object_id = r.id) AND (term_id = 18)) |
| Filter: ((object_type = 11) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[])) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[]))) |
| -> Subquery Scan on "*SELECT* 2" (cost=0.29..15.28 rows=1 width=9) |
| -> Nested Loop (cost=0.29..15.27 rows=1 width=17) |
| -> Seq Scan on tbl_erp_cost_tickets r_1 (cost=0.00..3.33 rows=1 width=4) |
| Filter: ((verify_at >= '2026-06-01 00:00:00+08'::timestamp with time zone) AND (verify_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (verify_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (verify_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (status = 2)) |
| -> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt_1 (cost=0.29..11.93 rows=1 width=13) |
| Index Cond: ((object_id = r_1.id) AND (term_id = 18)) |
| Filter: ((object_type = 9) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[])) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[]))) |
| -> Subquery Scan on "*SELECT* 3" (cost=0.29..13.20 rows=1 width=10) |
| -> Nested Loop (cost=0.29..13.19 rows=1 width=18) |
| -> Seq Scan on tbl_erp_cost_convert_tickets r_2 (cost=0.00..1.25 rows=1 width=4) |
| Filter: ((verify_at >= '2026-06-01 00:00:00+08'::timestamp with time zone) AND (verify_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (verify_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (verify_at <= '2026-06-30 23:59:59+08'::timestamp with time zone) AND (status = 2)) |
| -> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt_2 (cost=0.29..11.93 rows=1 width=14) |
| Index Cond: ((object_id = r_2.id) AND (term_id = 18)) |
| Filter: ((object_type = 10) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[])) AND (taxonomy_id = ANY ('{323,349,367,346,338,327,369,348,326,354,377,374,332,356,342,340,352,366,379,380,384,405,407,408,409,410,411,413,414,416,418,420,421,422,423,437,372,371,364,355,357,362,329,368,334,345,335,350,361,365,378,373,331,358,337,325,336,347,324,339,343,341,370,328,353,376,363,344,359,351,330,360,333,375}'::integer[]))) |