| Sort (cost=7484.74..7485.06 rows=128 width=477) |
| Sort Key: p.created_at DESC |
| -> HashAggregate (cost=1876.42..7480.26 rows=128 width=477) |
| Group Key: p.id |
| -> Merge Right Join (cost=797.54..1858.46 rows=1437 width=365) |
| Merge Cond: (sl.project_id = p.id) |
| -> Index Scan using tbl_work_logs_project_id_idx on tbl_work_logs sl (cost=0.29..6294.15 rows=35733 width=12) |
| -> Sort (cost=797.25..797.57 rows=128 width=357) |
| Sort Key: p.id |
| -> Nested Loop Left Join (cost=134.25..792.77 rows=128 width=357) |
| -> Hash Left Join (cost=133.96..321.07 rows=128 width=353) |
| Hash Cond: (p.client_id = c.id) |
| -> Seq Scan on tbl_projects p (cost=0.00..186.78 rows=128 width=349) |
| Filter: (creator = 1001) |
| -> Hash (cost=108.98..108.98 rows=1998 width=4) |
| -> Seq Scan on tbl_clients c (cost=0.00..108.98 rows=1998 width=4) |
| -> Index Scan using tbl_work_logs_client_id_idx on tbl_work_logs arrive (cost=0.29..3.68 rows=1 width=12) |
| Index Cond: ((client_id = c.id) AND (client_id IS NOT NULL)) |
| Filter: ((NOT is_draft) AND (location_in_id IS NOT NULL) AND (location_out_id IS NOT NULL) AND (scenario_id = 1)) |
| SubPlan 1 |
| -> Aggregate (cost=43.72..43.73 rows=1 width=32) |
| -> Seq Scan on tbl_invoices i (cost=0.00..43.71 rows=1 width=6) |
| Filter: (project_id = p.id) |