Aggregate (cost=1493.36..1493.37 rows=1 width=8) |
-> Sort (cost=1475.57..1478.53 rows=1186 width=998) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> HashAggregate (cost=1403.15..1415.01 rows=1186 width=998) |
Group Key: c.id |
-> Hash Left Join (cost=1005.37..1400.19 rows=1186 width=16) |
Hash Cond: (client.sales_rep = sgr.sales_id) |
-> Hash Right Join (cost=1003.31..1387.56 rows=1186 width=20) |
Hash Cond: (cs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships cs (cost=0.00..376.24 rows=1535 width=4) |
Filter: (object_type = 105) |
-> Hash (cost=988.48..988.48 rows=1186 width=20) |
-> Hash Right Join (cost=606.64..988.48 rows=1186 width=20) |
Hash Cond: (rs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships rs (cost=0.00..376.24 rows=1074 width=4) |
Filter: (object_type = 106) |
-> Hash (cost=591.81..591.81 rows=1186 width=20) |
-> Hash Right Join (cost=215.43..591.81 rows=1186 width=20) |
Hash Cond: (vs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships vs (cost=0.00..376.24 rows=29 width=4) |
Filter: (object_type = 107) |
-> Hash (cost=200.60..200.60 rows=1186 width=20) |
-> Hash Left Join (cost=141.34..200.60 rows=1186 width=20) |
Hash Cond: (c.client_id = client.id) |
Filter: ((client.sales_rep = ANY ('{5295,5311}'::integer[])) OR (client.sales_rep IS NULL) OR (hashed SubPlan 1)) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..55.24 rows=1524 width=24) |
-> Hash (cost=106.08..106.08 rows=1908 width=8) |
-> Seq Scan on tbl_clients client (cost=0.00..106.08 rows=1908 width=8) |
SubPlan 1 |
-> Seq Scan on tbl_user_visit_clients (cost=0.00..11.41 rows=1 width=4) |
Filter: (user_id = 5295) |
-> Hash (cost=1.47..1.47 rows=47 width=4) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.47 rows=47 width=4) |