| GroupAggregate (cost=218.34..218.57 rows=9 width=36) |
| Group Key: client.sales_rep |
| -> Sort (cost=218.34..218.38 rows=15 width=10) |
| Sort Key: client.sales_rep |
| -> Nested Loop (cost=0.28..218.05 rows=15 width=10) |
| -> Seq Scan on tbl_sales_contracts contract (cost=0.00..76.98 rows=29 width=10) |
| Filter: ((NOT COALESCE(is_draft, false)) AND COALESCE(need_analysis, true) AND (signed_at >= '2025-01-01'::date) AND (signed_at <= '2025-07-07'::date)) |
| -> Index Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..4.86 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[])) |