explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7uPM : Optimization for: plan #gHsn

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 0.019 ↑ 1.0 1 1

Aggregate (cost=1,515.17..1,515.18 rows=1 width=8) (actual time=0.019..0.019 rows=1 loops=1)

  • Output: count(*)
  • Buffers: shared hit=3
2. 0.000 0.017 ↓ 0.0 0 1

Unique (cost=1,514.83..1,515.08 rows=7 width=4) (actual time=0.017..0.017 rows=0 loops=1)

  • Output: trainings.id
  • Buffers: shared hit=3
3. 0.004 0.017 ↓ 0.0 0 1

Sort (cost=1,514.83..1,514.96 rows=49 width=4) (actual time=0.017..0.017 rows=0 loops=1)

  • Output: trainings.id
  • Sort Key: trainings.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=3
4. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=1.28..1,513.46 rows=49 width=4) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: trainings.id
  • Buffers: shared hit=3
5. 0.000 0.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.71..18.57 rows=7 width=4) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: workouts.id
  • Join Filter: (exercise_workouts.workout_id = workouts.id)
  • Buffers: shared hit=3
6. 0.013 0.013 ↓ 0.0 0 1

Index Scan using workouts_pkey on public.workouts (cost=0.29..4.31 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: workouts.id
  • Index Cond: (workouts.id = 1)
  • Filter: (workouts.category <> ALL ('{1,2}'::integer[]))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=3
7. 0.000 0.000 ↓ 0.0 0

Index Scan using index_ew_on_exercise_id_and_round_and_table_order on public.exercise_workouts (cost=0.42..14.17 rows=7 width=8) (never executed)

  • Output: exercise_workouts.id, exercise_workouts.exercise_id, exercise_workouts.workout_id, exercise_workouts.round, exercise_workouts.quantity_description, exercise_workouts.table_order, exercise_workouts.created_at, exercise_workouts.updated_at, exercise_workouts.quantity, exercise_workouts.termination_criteria, exercise_workouts.percent_one_rep_max, exercise_workouts.round_type, exercise_workouts.pace
  • Index Cond: (exercise_workouts.workout_id = 1)
8. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.57..1,494.29 rows=7 width=12) (never executed)

  • Output: trainings.id, trainings.training_spot_id, trainings.workout_id
9. 0.000 0.000 ↓ 0.0 0

Index Scan using index_trainings_on_user_id on public.trainings (cost=0.57..1,494.26 rows=7 width=12) (never executed)

  • Output: trainings.id, trainings.training_spot_id, trainings.workout_id
  • Index Cond: (trainings.user_id = 1234)
  • Filter: (trainings.workout_id = 1)
Planning time : 0.310 ms
Execution time : 0.053 ms