Aggregate (cost=1324.49..1324.50 rows=1 width=8) |
-> Sort (cost=1321.75..1322.20 rows=183 width=998) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=1313.39..1314.87 rows=183 width=998) |
Group Key: c.id |
-> Merge Left Join (cost=1313.39..1314.41 rows=183 width=16) |
Merge Cond: (c.id = vs.object_id) |
-> Sort (cost=936.45..936.90 rows=183 width=16) |
Sort Key: c.id |
-> Hash Left Join (cost=544.71..929.57 rows=183 width=16) |
Hash Cond: (client.sales_rep = sgr.sales_id) |
-> Hash Right Join (cost=543.11..925.45 rows=183 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=540.82..540.82 rows=183 width=20) |
-> Hash Right Join (cost=160.32..540.82 rows=183 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=158.03..158.03 rows=183 width=20) |
-> Hash Join (cost=98.78..158.03 rows=183 width=20) |
Hash Cond: (c.client_id = client.id) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..55.24 rows=1524 width=24) |
-> Hash (cost=95.91..95.91 rows=229 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=6.05..95.91 rows=229 width=8) |
Recheck Cond: (sales_rep = 5311) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..6.00 rows=229 width=0) |
Index Cond: (sales_rep = 5311) |
-> Hash (cost=1.59..1.59 rows=1 width=4) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.59 rows=1 width=4) |
Filter: (sales_id = 5311) |
-> 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) |