Limit (cost=1449.45..1449.48 rows=10 width=188) |
-> Sort (cost=1449.45..1452.42 rows=1185 width=188) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> HashAggregate (cost=1403.11..1423.85 rows=1185 width=188) |
Group Key: c.id |
-> Hash Left Join (cost=1005.33..1400.15 rows=1185 width=180) |
Hash Cond: (client.sales_rep = sgr.sales_id) |
-> Hash Right Join (cost=1003.27..1387.53 rows=1185 width=184) |
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.46..988.46 rows=1185 width=184) |
-> Hash Right Join (cost=606.61..988.46 rows=1185 width=184) |
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.80..591.80 rows=1185 width=184) |
-> Hash Right Join (cost=215.42..591.80 rows=1185 width=184) |
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=1185 width=184) |
-> Hash Left Join (cost=141.34..200.60 rows=1185 width=184) |
Hash Cond: (c.client_id = client.id) |
Filter: ((client.sales_rep = ANY ('{5300,5309,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=180) |
-> 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 = 5300) |
-> 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) |