GroupAggregate (cost=405.29..413.44 rows=1 width=172) |
Group Key: contact.id |
-> Nested Loop Left Join (cost=405.29..413.40 rows=1 width=140) |
Join Filter: (pcp.contact_id = contact.id) |
-> Nested Loop (cost=201.34..209.42 rows=1 width=108) |
-> GroupAggregate (cost=201.06..201.10 rows=1 width=108) |
Group Key: p.from_contact |
-> Sort (cost=201.06..201.07 rows=1 width=23) |
Sort Key: p.from_contact |
-> Nested Loop (cost=0.28..201.05 rows=1 width=23) |
-> Seq Scan on tbl_projects p (cost=0.00..192.69 rows=1 width=27) |
Filter: ((from_contact IS NOT NULL) AND (bargain_date >= '2025-01-01'::date) AND (bargain_date <= '2025-12-31'::date) AND (project_status = 3)) |
-> Index Scan using tbl_clients_pkey on tbl_clients c (cost=0.28..8.35 rows=1 width=4) |
Index Cond: (id = p.client_id) |
Filter: (sales_rep = ANY ('{5301,5209,5026,5293,5309,5356,5329,5299,5303,5302,5332,5096,5448,5420,1001,5087,1008,5230,5088,5208,1003,5294,5357,5076,5300,5089,5311,5364,5295,1013,5128,5203,1004,5072,5359,5412,5409,5229,1005,5304,5449,5358,1006,5093}'::integer[])) |
-> Index Only Scan using tbl_contacts_pkey on tbl_contacts contact (cost=0.28..8.30 rows=1 width=4) |
Index Cond: (id = p.from_contact) |
-> GroupAggregate (cost=203.94..203.96 rows=1 width=36) |
Group Key: pcp.contact_id |
-> Sort (cost=203.94..203.95 rows=1 width=9) |
Sort Key: pcp.contact_id |
-> Nested Loop (cost=194.60..203.93 rows=1 width=9) |
-> Hash Join (cost=194.33..200.02 rows=1 width=13) |
Hash Cond: ((pcp.contact_id = p_1.from_contact) AND (pcp.project_id = p_1.id)) |
-> Seq Scan on tbl_project_contact_points pcp (cost=0.00..4.42 rows=242 width=13) |
-> Hash (cost=192.69..192.69 rows=109 width=12) |
-> Seq Scan on tbl_projects p_1 (cost=0.00..192.69 rows=109 width=12) |
Filter: ((id IS NOT NULL) AND (bargain_date >= '2025-01-01'::date) AND (bargain_date <= '2025-12-31'::date) AND (project_status = 3)) |
-> Index Scan using tbl_clients_pkey on tbl_clients c_1 (cost=0.28..3.91 rows=1 width=4) |
Index Cond: (id = p_1.client_id) |
Filter: (sales_rep = ANY ('{5301,5209,5026,5293,5309,5356,5329,5299,5303,5302,5332,5096,5448,5420,1001,5087,1008,5230,5088,5208,1003,5294,5357,5076,5300,5089,5311,5364,5295,1013,5128,5203,1004,5072,5359,5412,5409,5229,1005,5304,5449,5358,1006,5093}'::integer[])) |