Aggregate (cost=1421.83..1421.84 rows=1 width=8) |
-> Sort (cost=1410.78..1412.62 rows=737 width=998) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> HashAggregate (cost=1368.31..1375.68 rows=737 width=998) |
Group Key: c.id |
-> Hash Left Join (cost=976.50..1366.47 rows=737 width=16) |
Hash Cond: (client.sales_rep = sgr.sales_id) |
-> Hash Right Join (cost=974.44..1357.83 rows=737 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=965.23..965.23 rows=737 width=20) |
-> Hash Right Join (cost=583.98..965.23 rows=737 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=574.77..574.77 rows=737 width=20) |
-> Hash Right Join (cost=198.39..574.77 rows=737 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=189.18..189.18 rows=737 width=20) |
-> Hash Left Join (cost=129.93..189.18 rows=737 width=20) |
Hash Cond: (c.client_id = client.id) |
Filter: (client.sales_rep IS NULL) |
-> 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) |
-> 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) |