explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3GoF

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.827 27.808 ↓ 1.0 208 1

Hash Join (cost=19.98..11,745.60 rows=207 width=542) (actual time=1.502..27.808 rows=208 loops=1)

  • Hash Cond: (t.order_id = o.order_id)
2. 0.139 0.815 ↓ 1.0 208 1

Hash Join (cost=8.59..16.49 rows=207 width=412) (actual time=0.446..0.815 rows=208 loops=1)

  • Hash Cond: (t.project_id = p.project_id)
3. 0.114 0.536 ↓ 1.0 208 1

Hash Left Join (cost=3.31..10.65 rows=207 width=399) (actual time=0.272..0.536 rows=208 loops=1)

  • Hash Cond: (tw.worker_id = u.user_id)
4. 0.165 0.372 ↓ 1.0 208 1

Hash Left Join (cost=2.01..8.64 rows=207 width=309) (actual time=0.186..0.372 rows=208 loops=1)

  • Hash Cond: (t.task_id = tw.task_id)
5. 0.116 0.116 ↓ 1.0 208 1

Seq Scan on tasks t (cost=0.00..6.07 rows=207 width=183) (actual time=0.034..0.116 rows=208 loops=1)

  • Filter: (removed_at IS NULL)
6. 0.047 0.091 ↓ 1.2 52 1

Hash (cost=1.45..1.45 rows=45 width=134) (actual time=0.091..0.091 rows=52 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
7. 0.044 0.044 ↓ 1.2 52 1

Seq Scan on task_workers tw (cost=0.00..1.45 rows=45 width=134) (actual time=0.016..0.044 rows=52 loops=1)

8. 0.031 0.050 ↑ 1.0 13 1

Hash (cost=1.13..1.13 rows=13 width=98) (actual time=0.050..0.050 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
9. 0.019 0.019 ↑ 1.0 13 1

Seq Scan on users u (cost=0.00..1.13 rows=13 width=98) (actual time=0.011..0.019 rows=13 loops=1)

10. 0.073 0.140 ↑ 1.3 109 1

Hash (cost=3.46..3.46 rows=146 width=21) (actual time=0.140..0.140 rows=109 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
11. 0.067 0.067 ↑ 1.3 109 1

Seq Scan on projects p (cost=0.00..3.46 rows=146 width=21) (actual time=0.014..0.067 rows=109 loops=1)

12. 0.169 0.374 ↑ 1.0 195 1

Hash (cost=8.95..8.95 rows=195 width=26) (actual time=0.374..0.374 rows=195 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
13. 0.205 0.205 ↑ 1.0 195 1

Seq Scan on orders o (cost=0.00..8.95 rows=195 width=26) (actual time=0.013..0.205 rows=195 loops=1)

14.          

SubPlan (forHash Join)

15. 0.624 6.864 ↑ 1.0 1 208

Aggregate (cost=23.47..23.48 rows=1 width=32) (actual time=0.033..0.033 rows=1 loops=208)

16. 0.208 6.240 ↑ 2.0 1 208

Subquery Scan on t1 (cost=0.55..23.46 rows=2 width=94) (actual time=0.025..0.030 rows=1 loops=208)

17. 0.208 6.032 ↑ 2.0 1 208

Limit (cost=0.55..23.44 rows=2 width=70) (actual time=0.024..0.029 rows=1 loops=208)

18. 0.162 5.824 ↑ 2.0 1 208

Nested Loop Left Join (cost=0.55..23.44 rows=2 width=70) (actual time=0.024..0.028 rows=1 loops=208)

19. 0.081 5.408 ↑ 2.0 1 208

Nested Loop Left Join (cost=0.28..22.34 rows=2 width=8) (actual time=0.022..0.026 rows=1 loops=208)

  • Join Filter: (sf.file_id = wsf.file_id)
  • Rows Removed by Join Filter: 2
20. 0.324 5.200 ↑ 2.0 1 208

Nested Loop (cost=0.28..21.21 rows=2 width=16) (actual time=0.021..0.025 rows=1 loops=208)

21. 4.368 4.368 ↑ 2.0 1 208

Seq Scan on task_source_files sf (cost=0.00..4.60 rows=2 width=8) (actual time=0.018..0.021 rows=1 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 145
22. 0.508 0.508 ↑ 1.0 1 127

Index Scan using files_pkey on files f_1 (cost=0.28..8.29 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=127)

  • Index Cond: (file_id = sf.file_id)
23. 0.113 0.127 ↑ 1.0 3 127

Materialize (cost=0.00..1.04 rows=3 width=8) (actual time=0.000..0.001 rows=3 loops=127)

24. 0.014 0.014 ↑ 1.0 3 1

Seq Scan on task_worker_source_files wsf (cost=0.00..1.03 rows=3 width=8) (actual time=0.010..0.014 rows=3 loops=1)

25. 0.254 0.254 ↑ 1.0 1 127

Index Scan using files_pkey on files f (cost=0.28..0.55 rows=1 width=70) (actual time=0.002..0.002 rows=1 loops=127)

  • Index Cond: (f_1.file_id = file_id)
26. 0.624 5.616 ↑ 1.0 1 208

Aggregate (cost=4.67..4.68 rows=1 width=32) (actual time=0.027..0.027 rows=1 loops=208)

27. 4.992 4.992 ↑ 2.0 1 208

Seq Scan on task_source_files (cost=0.00..4.60 rows=2 width=8) (actual time=0.018..0.024 rows=1 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 161
28. 0.208 6.448 ↑ 1.0 1 208

Aggregate (cost=22.40..22.41 rows=1 width=32) (actual time=0.031..0.031 rows=1 loops=208)

29. 0.254 6.240 ↑ 2.0 1 208

Nested Loop Left Join (cost=0.28..22.34 rows=2 width=16) (actual time=0.022..0.030 rows=1 loops=208)

  • Join Filter: (sf_1.file_id = wsf_1.file_id)
  • Rows Removed by Join Filter: 2
30. 0.346 5.824 ↑ 2.0 1 208

Nested Loop (cost=0.28..21.21 rows=2 width=16) (actual time=0.021..0.028 rows=1 loops=208)

31. 4.992 4.992 ↑ 2.0 1 208

Seq Scan on task_source_files sf_1 (cost=0.00..4.60 rows=2 width=16) (actual time=0.018..0.024 rows=1 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 161
32. 0.486 0.486 ↑ 1.0 1 162

Index Scan using files_pkey on files f_2 (cost=0.28..8.29 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=162)

  • Index Cond: (file_id = sf_1.file_id)
33. 0.153 0.162 ↑ 1.0 3 162

Materialize (cost=0.00..1.04 rows=3 width=16) (actual time=0.000..0.001 rows=3 loops=162)

34. 0.009 0.009 ↑ 1.0 3 1

Seq Scan on task_worker_source_files wsf_1 (cost=0.00..1.03 rows=3 width=16) (actual time=0.007..0.009 rows=3 loops=1)

35. 0.416 5.408 ↑ 1.0 1 208

Aggregate (cost=4.60..4.61 rows=1 width=8) (actual time=0.026..0.026 rows=1 loops=208)

36. 4.992 4.992 ↑ 2.0 1 208

Seq Scan on task_source_files task_source_files_1 (cost=0.00..4.60 rows=2 width=8) (actual time=0.018..0.024 rows=1 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 161
37. 0.208 1.456 ↑ 1.0 1 208

Aggregate (cost=1.40..1.41 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=208)

38. 1.248 1.248 ↓ 0.0 0 208

Seq Scan on task_result_files (cost=0.00..1.39 rows=3 width=8) (actual time=0.005..0.006 rows=0 loops=208)

  • Filter: (task_id = t.task_id)
  • Rows Removed by Filter: 31