| Sort (cost=7435.90..7436.22 rows=127 width=477) |
| Sort Key: p.created_at DESC |
| -> HashAggregate (cost=1871.40..7431.46 rows=127 width=477) |
| Group Key: p.id |
| -> Merge Right Join (cost=792.54..1853.45 rows=1436 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=792.25..792.57 rows=127 width=357) |
| Sort Key: p.id |
| -> Nested Loop Left Join (cost=134.25..787.81 rows=127 width=357) |
| -> Hash Left Join (cost=133.96..319.79 rows=127 width=353) |
| Hash Cond: (p.client_id = c.id) |
| -> Seq Scan on tbl_projects p (cost=0.00..185.50 rows=127 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) |