Limit (cost=2131.67..2131.69 rows=10 width=201) |
-> Sort (cost=2131.67..2132.18 rows=206 width=201) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=2119.26..2127.21 rows=206 width=201) |
Group Key: c.id |
-> Nested Loop Left Join (cost=2119.26..2125.15 rows=206 width=193) |
Join Filter: (sgr.sales_id = client.sales_rep) |
-> Merge Left Join (cost=2119.26..2120.45 rows=206 width=197) |
Merge Cond: (c.id = vs.object_id) |
-> Sort (cost=1475.54..1476.05 rows=206 width=197) |
Sort Key: c.id |
-> Hash Right Join (cost=818.46..1467.62 rows=206 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=815.88..815.88 rows=206 width=197) |
-> Hash Right Join (cost=168.75..815.88 rows=206 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=166.18..166.18 rows=206 width=197) |
-> Hash Join (cost=98.07..166.18 rows=206 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=95.10..95.10 rows=238 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=6.12..95.10 rows=238 width=8) |
Recheck Cond: (sales_rep = 5332) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..6.06 rows=238 width=0) |
Index Cond: (sales_rep = 5332) |
-> 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 = 5332) |