Limit (cost=1278.34..1278.37 rows=10 width=188) |
-> Sort (cost=1278.34..1278.42 rows=31 width=188) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=1277.28..1277.67 rows=31 width=188) |
Group Key: c.id |
-> Sort (cost=1277.28..1277.36 rows=31 width=180) |
Sort Key: c.id |
-> Nested Loop Left Join (cost=898.11..1276.52 rows=31 width=180) |
Join Filter: (sgr.sales_id = client.sales_rep) |
-> Hash Right Join (cost=898.11..1274.46 rows=31 width=184) |
Hash Cond: (vs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships vs (cost=0.00..376.24 rows=29 width=4) |
Filter: (object_type = 107) |
-> Hash (cost=897.72..897.72 rows=31 width=184) |
-> Hash Right Join (cost=515.66..897.72 rows=31 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=515.28..515.28 rows=31 width=184) |
-> Hash Right Join (cost=134.97..515.28 rows=31 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=134.58..134.58 rows=31 width=184) |
-> Hash Join (cost=75.33..134.58 rows=31 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=74.85..74.85 rows=39 width=8) |
-> Bitmap Heap Scan on tbl_clients client (cost=4.58..74.85 rows=39 width=8) |
Recheck Cond: (sales_rep = 5295) |
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..4.57 rows=39 width=0) |
Index Cond: (sales_rep = 5295) |
-> 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 = 5295) |