explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Bs5n : Optimization for: plan #Ubpe

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.011 0.205 ↑ 1.0 2 1

Merge Join (cost=34.19..34.25 rows=2 width=129) (actual time=0.202..0.205 rows=2 loops=1)

2. 0.013 0.137 ↑ 1.0 2 1

Sort (cost=31.65..31.65 rows=2 width=148) (actual time=0.137..0.137 rows=2 loops=1)

  • Sort Key: sp.id
  • Sort Method: quicksort Memory: 25kB
3. 0.031 0.124 ↑ 1.0 2 1

Hash Join (cost=27.62..31.64 rows=2 width=148) (actual time=0.119..0.124 rows=2 loops=1)

4. 0.007 0.069 ↑ 22.9 7 1

Aggregate (cost=26.43..28.03 rows=160 width=45) (actual time=0.068..0.069 rows=7 loops=1)

5. 0.021 0.062 ↑ 12.3 13 1

Hash Join (cost=13.6..25.63 rows=160 width=41) (actual time=0.055..0.062 rows=13 loops=1)

6. 0.011 0.011 ↑ 8.0 20 1

Seq Scan on step_definitions sdc (cost=0..11.6 rows=160 width=8) (actual time=0.008..0.011 rows=20 loops=1)

7. 0.007 0.030 ↑ 8.0 20 1

Hash (cost=11.6..11.6 rows=160 width=37) (actual time=0.03..0.03 rows=20 loops=1)

8. 0.023 0.023 ↑ 8.0 20 1

Seq Scan on step_definitions sd (cost=0..11.6 rows=160 width=37) (actual time=0.003..0.023 rows=20 loops=1)

9. 0.009 0.024 ↑ 1.0 2 1

Hash (cost=1.16..1.16 rows=2 width=107) (actual time=0.024..0.024 rows=2 loops=1)

10. 0.015 0.015 ↑ 1.0 2 1

Seq Scan on step_participations sp (cost=0..1.16 rows=2 width=107) (actual time=0.011..0.015 rows=2 loops=1)

  • Filter: ((type)::text = 'StepParticipations::TodoParticipation'::text)
11. 0.011 0.057 ↑ 1.0 3 1

Sort (cost=2.54..2.55 rows=3 width=16) (actual time=0.056..0.057 rows=3 loops=1)

  • Sort Key: completed_child_per_participant.id
  • Sort Method: quicksort Memory: 25kB
12. 0.001 0.046 ↑ 1.0 3 1

Subquery Scan on completed_child_per_participant (cost=2.46..2.52 rows=3 width=16) (actual time=0.045..0.046 rows=3 loops=1)

13. 0.005 0.045 ↑ 1.0 3 1

Aggregate (cost=2.46..2.49 rows=3 width=16) (actual time=0.044..0.045 rows=3 loops=1)

14. 0.021 0.040 ↓ 1.7 5 1

Hash Join (cost=1.19..2.43 rows=3 width=12) (actual time=0.036..0.04 rows=5 loops=1)

15. 0.006 0.006 ↑ 1.0 13 1

Seq Scan on step_participations sp_1 (cost=0..1.13 rows=13 width=4) (actual time=0.004..0.006 rows=13 loops=1)

  • Filter: (deleted_at IS NULL)
16. 0.000 0.013 ↑ 1.0 5 1

Hash (cost=1.13..1.13 rows=5 width=12) (actual time=0.013..0.013 rows=5 loops=1)

17. 0.013 0.013 ↑ 1.0 5 1

Seq Scan on step_participations spc (cost=0..1.13 rows=5 width=12) (actual time=0.01..0.013 rows=5 loops=1)

  • Filter: ((completed_at IS NOT NULL) AND (deleted_at IS NULL) AND (participant_id IS NOT NULL))
Planning time : 0.543 ms
Execution time : 0.461 ms