| Aggregate (cost=2320.93..2320.94 rows=1 width=8) |
| -> Sort (cost=2320.75..2320.78 rows=12 width=1104) |
| Sort Key: c.signed_at DESC, c.created_at DESC |
| -> Group (cost=2320.28..2320.54 rows=12 width=1104) |
| Group Key: c.id |
| -> Merge Left Join (cost=2320.28..2320.51 rows=12 width=16) |
| Merge Cond: (c.id = vs.object_id) |
| -> Sort (cost=1577.22..1577.25 rows=12 width=16) |
| Sort Key: c.id |
| -> Nested Loop (cost=829.00..1577.01 rows=12 width=16) |
| -> Hash Right Join (cost=8.31..9.96 rows=1 width=4) |
| Hash Cond: (sgr.sales_id = client.sales_rep) |
| -> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.51 rows=51 width=4) |
| -> Hash (cost=8.29..8.29 rows=1 width=8) |
| -> Index Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..8.29 rows=1 width=8) |
| Index Cond: (id = 2032) |
| -> Hash Right Join (cost=820.69..1566.93 rows=12 width=20) |
| Hash Cond: (rs.object_id = c.id) |
| -> Seq Scan on tbl_attachement_relationships rs (cost=0.00..741.68 rows=1211 width=4) |
| Filter: (object_type = 106) |
| -> Hash (cost=820.54..820.54 rows=12 width=20) |
| -> Hash Right Join (cost=74.23..820.54 rows=12 width=20) |
| Hash Cond: (cs.object_id = c.id) |
| -> Seq Scan on tbl_attachement_relationships cs (cost=0.00..741.68 rows=1768 width=4) |
| Filter: (object_type = 105) |
| -> Hash (cost=74.08..74.08 rows=12 width=24) |
| -> Seq Scan on tbl_sales_contracts c (cost=0.00..74.08 rows=12 width=24) |
| Filter: (client_id = 2032) |
| -> Sort (cost=743.05..743.17 rows=49 width=4) |
| Sort Key: vs.object_id |
| -> Seq Scan on tbl_attachement_relationships vs (cost=0.00..741.68 rows=49 width=4) |
| Filter: (object_type = 107) |