Aggregate (cost=2102.40..2102.41 rows=1 width=8) |
-> Sort (cost=2101.65..2101.77 rows=50 width=1067) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=2099.99..2100.24 rows=50 width=1067) |
Group Key: c.id |
-> Sort (cost=2099.99..2100.11 rows=50 width=16) |
Sort Key: c.id |
-> Hash Left Join (cost=1449.03..2098.58 rows=50 width=16) |
Hash Cond: (client.sales_rep = sgr.sales_id) |
-> Hash Right Join (cost=1447.41..2096.26 rows=50 width=20) |
Hash Cond: (cs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships cs (cost=0.00..642.56 rows=1655 width=4) |
Filter: (object_type = 105) |
-> Hash (cost=1446.78..1446.78 rows=50 width=20) |
-> Hash Right Join (cost=799.85..1446.78 rows=50 width=20) |
Hash Cond: (rs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships rs (cost=0.00..642.56 rows=1146 width=4) |
Filter: (object_type = 106) |
-> Hash (cost=799.23..799.23 rows=50 width=20) |
-> Hash Right Join (cost=156.49..799.23 rows=50 width=20) |
Hash Cond: (vs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships vs (cost=0.00..642.56 rows=43 width=4) |
Filter: (object_type = 107) |
-> Hash (cost=155.87..155.87 rows=50 width=20) |
-> Hash Join (cost=87.76..155.87 rows=50 width=20) |
Hash Cond: (c.client_id = client.id) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..63.71 rows=1671 width=24) |
-> Hash (cost=87.03..87.03 rows=58 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=4.73..87.03 rows=58 width=8) |
Recheck Cond: (sales_rep = 1001) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..4.71 rows=58 width=0) |
Index Cond: (sales_rep = 1001) |
-> Hash (cost=1.61..1.61 rows=1 width=4) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.61 rows=1 width=4) |
Filter: (sales_id = 1001) |