| GroupAggregate (cost=231.65..231.89 rows=9 width=36) |
| Group Key: client.sales_rep |
| -> Sort (cost=231.65..231.69 rows=17 width=10) |
| Sort Key: client.sales_rep |
| -> Nested Loop (cost=0.28..231.30 rows=17 width=10) |
| -> Seq Scan on tbl_sales_contracts contract (cost=0.00..76.98 rows=33 width=10) |
| Filter: ((NOT COALESCE(is_draft, false)) AND COALESCE(need_analysis, true) AND (signed_at >= '2025-06-27'::date) AND (signed_at <= '2025-12-31'::date)) |
| -> Index Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..4.68 rows=1 width=8) |
| Index Cond: (id = contract.client_id) |
| Filter: (sales_rep = ANY ('{5500,5499,5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])) |