Limit (cost=1286.36..1286.39 rows=10 width=188) |
-> Sort (cost=1286.36..1286.46 rows=39 width=188) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=1282.65..1285.52 rows=39 width=188) |
Group Key: c.id |
-> Nested Loop Left Join (cost=1282.65..1285.13 rows=39 width=180) |
Join Filter: (sgr.sales_id = client.sales_rep) |
-> Merge Left Join (cost=1282.65..1282.95 rows=39 width=184) |
Merge Cond: (c.id = vs.object_id) |
-> Sort (cost=905.71..905.80 rows=39 width=184) |
Sort Key: c.id |
-> Hash Right Join (cost=522.61..904.68 rows=39 width=184) |
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=522.12..522.12 rows=39 width=184) |
-> Hash Right Join (cost=141.81..522.12 rows=39 width=184) |
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=141.32..141.32 rows=39 width=184) |
-> Hash Join (cost=82.07..141.32 rows=39 width=184) |
Hash Cond: (c.client_id = client.id) |
-> Seq Scan on tbl_sales_contracts c (cost=0.00..55.24 rows=1524 width=180) |
-> Hash (cost=81.47..81.47 rows=48 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=4.65..81.47 rows=48 width=8) |
Recheck Cond: (sales_rep = 5329) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..4.64 rows=48 width=0) |
Index Cond: (sales_rep = 5329) |
-> 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=0.00..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 = 5329) |