Aggregate (cost=1206.70..1206.71 rows=1 width=8) |
-> Sort (cost=1206.67..1206.67 rows=2 width=998) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=1204.90..1206.66 rows=2 width=998) |
Group Key: c.id |
-> Nested Loop (cost=1204.90..1206.65 rows=2 width=16) |
-> Merge Left Join (cost=1196.59..1196.71 rows=2 width=20) |
Merge Cond: (c.id = vs.object_id) |
-> Sort (cost=819.65..819.66 rows=2 width=20) |
Sort Key: c.id |
-> Hash Right Join (cost=439.37..819.64 rows=2 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=439.34..439.34 rows=2 width=20) |
-> Hash Right Join (cost=59.07..439.34 rows=2 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=59.05..59.05 rows=2 width=24) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..59.05 rows=2 width=24) |
Filter: (client_id = 3304) |
-> Sort (cost=376.94..377.01 rows=29 width=4) |
Sort Key: vs.object_id |
-> Seq Scan on tbl_attachement_relationships vs (cost=0.00..376.24 rows=29 width=4) |
Filter: (object_type = 107) |
-> Materialize (cost=8.31..9.92 rows=1 width=4) |
-> Hash Right Join (cost=8.31..9.91 rows=1 width=4) |
Hash Cond: (sgr.sales_id = client.sales_rep) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.47 rows=47 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 = 3304) |