Limit (cost=2089.20..2089.22 rows=10 width=201) |
-> Sort (cost=2089.20..2089.28 rows=35 width=201) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=2085.62..2088.44 rows=35 width=201) |
Group Key: c.id |
-> Nested Loop Left Join (cost=2085.62..2088.09 rows=35 width=193) |
Join Filter: (sgr.sales_id = client.sales_rep) |
-> Merge Left Join (cost=2085.62..2085.95 rows=35 width=197) |
Merge Cond: (c.id = vs.object_id) |
-> Sort (cost=1441.89..1441.98 rows=35 width=197) |
Sort Key: c.id |
-> Hash Right Join (cost=792.15..1440.99 rows=35 width=197) |
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=791.72..791.72 rows=35 width=197) |
-> Hash Right Join (cost=144.81..791.72 rows=35 width=197) |
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=144.37..144.37 rows=35 width=197) |
-> Hash Join (cost=76.26..144.37 rows=35 width=197) |
Hash Cond: (c.client_id = client.id) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..63.71 rows=1671 width=193) |
-> Hash (cost=75.76..75.76 rows=40 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=4.59..75.76 rows=40 width=8) |
Recheck Cond: (sales_rep = 5087) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..4.58 rows=40 width=0) |
Index Cond: (sales_rep = 5087) |
-> Sort (cost=643.73..643.84 rows=43 width=4) |
Sort Key: vs.object_id |
-> Seq Scan on tbl_attachement_relationships vs (cost=0.00..642.56 rows=43 width=4) |
Filter: (object_type = 107) |
-> Materialize (cost=0.00..1.62 rows=1 width=4) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.61 rows=1 width=4) |
Filter: (sales_id = 5087) |