explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ktRQ : Optimization for: plan #3GoF

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.027 27.773 ↑ 1.0 208 1

Hash Join (cost=19.98..11,802.22 rows=208 width=542) (actual time=1.071..27.773 rows=208 loops=1)

  • Hash Cond: (t.order_id = o.order_id)
  • Planning time: 8.225 ms
  • Execution time: 29.616 ms
2. 0.138 0.712 ↑ 1.0 208 1

Hash Join (cost=8.59..16.51 rows=208 width=412) (actual time=0.308..0.712 rows=208 loops=1)

  • Hash Cond: (t.project_id = p.project_id)
3. 0.107 0.466 ↑ 1.0 208 1

Hash Left Join (cost=3.31..10.67 rows=208 width=399) (actual time=0.177..0.466 rows=208 loops=1)

  • Hash Cond: (tw.worker_id = u.user_id)
4. 0.145 0.325 ↑ 1.0 208 1

Hash Left Join (cost=2.01..8.65 rows=208 width=309) (actual time=0.120..0.325 rows=208 loops=1)

  • Hash Cond: (t.task_id = tw.task_id)
5. 0.119 0.119 ↑ 1.0 208 1

Seq Scan on tasks t (cost=0.00..6.08 rows=208 width=183) (actual time=0.030..0.119 rows=208 loops=1)

  • Filter: (removed_at IS NULL)
6. 0.030 0.061 ↓ 1.2 52 1

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

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

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

8. 0.020 0.034 ↑ 1.0 13 1

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

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

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

10. 0.059 0.108 ↑ 1.3 109 1

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

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

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

12. 0.091 0.242 ↑ 1.0 195 1

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

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

Seq Scan on orders o (cost=0.00..8.95 rows=195 width=26) (actual time=0.017..0.151 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.000 6.240 ↑ 2.0 1 208

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

17. 0.208 6.240 ↑ 2.0 1 208

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

18. 0.162 6.032 ↑ 2.0 1 208

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

19. 0.081 5.616 ↑ 2.0 1 208

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

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

Nested Loop (cost=0.28..21.21 rows=2 width=16) (actual time=0.022..0.026 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.110 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.017 0.017 ↑ 1.0 3 1

Seq Scan on task_worker_source_files wsf (cost=0.00..1.03 rows=3 width=8) (actual time=0.014..0.017 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.416 6.240 ↑ 2.0 1 208

Nested Loop Left Join (cost=0.28..22.34 rows=2 width=16) (actual time=0.023..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.022..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.019..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.000 0.000 ↑ 1.0 3 162

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

34. 0.006 0.006 ↑ 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.005..0.006 rows=3 loops=1)

35. 0.624 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.784 4.784 ↑ 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.023 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.006..0.006 rows=0 loops=208)

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