explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ldgA

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 27.712 ↓ 2.0 2 1

Unique (cost=1,765.03..1,765.04 rows=1 width=44) (actual time=27.682..27.712 rows=2 loops=1)

2. 0.033 27.684 ↓ 2.0 2 1

Sort (cost=1,765.03..1,765.04 rows=1 width=44) (actual time=27.672..27.684 rows=2 loops=1)

  • Sort Key: wr.child_id, ((SubPlan 4))
  • Sort Method: quicksort Memory: 26kB
3. 0.055 27.651 ↓ 2.0 2 1

Group (cost=17.23..1,765.02 rows=1 width=44) (actual time=21.094..27.651 rows=2 loops=1)

  • Group Key: wr.child_id, wr.class_id, wr.routine_date
4. 0.049 0.182 ↓ 4.0 4 1

Sort (cost=17.23..17.24 rows=1 width=12) (actual time=0.161..0.182 rows=4 loops=1)

  • Sort Key: wr.child_id, wr.routine_date
  • Sort Method: quicksort Memory: 25kB
5. 0.060 0.133 ↓ 4.0 4 1

Nested Loop (cost=0.45..17.22 rows=1 width=12) (actual time=0.044..0.133 rows=4 loops=1)

6. 0.045 0.045 ↓ 4.0 4 1

Index Scan using weekly_routine_date_class_idx on weekly_routine wr (cost=0.30..9.04 rows=1 width=16) (actual time=0.022..0.045 rows=4 loops=1)

  • Index Cond: ((routine_date >= (date_trunc('week'::text, ('2019-05-27'::date)::timestamp with time zone) - '1 day'::interval)) AND (routine_date < (date_trunc('week'::text, ('2019-05-27'::date)::timestamp with time zone) + '
7. 0.028 0.028 ↑ 1.0 1 4

Index Scan using routine_pkey on routine r (cost=0.15..8.17 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=4)

  • Index Cond: (routine_id = wr.routine_id)
  • Filter: (odl_version_id = 1)
8.          

SubPlan (for Group)

9. 0.284 27.414 ↑ 1.0 1 2

Aggregate (cost=1,747.77..1,747.78 rows=1 width=32) (actual time=13.701..13.707 rows=1 loops=2)

10. 0.054 0.054 ↓ 2.0 2 2

Index Scan using weekly_routine_date_class_idx on weekly_routine _wr (cost=0.29..8.31 rows=1 width=8) (actual time=0.010..0.027 rows=2 loops=2)

  • Index Cond: ((wr.routine_date = routine_date) AND (wr.class_id = class_id))
  • Filter: (wr.child_id = child_id)
  • Rows Removed by Filter: 2
11.          

SubPlan (for Aggregate)

12. 0.264 22.920 ↑ 1.0 1 4

Aggregate (cost=1,362.05..1,362.06 rows=1 width=32) (actual time=5.725..5.730 rows=1 loops=4)

13. 3.300 22.656 ↑ 2.7 3 4

Nested Loop (cost=0.00..1,361.95 rows=8 width=29) (actual time=2.644..5.664 rows=3 loops=4)

  • Join Filter: (wrca.careplan_id = rc.careplan_id)
  • Rows Removed by Join Filter: 102
14. 0.660 0.660 ↑ 1.0 38 4

Seq Scan on routine_careplan rc (cost=0.00..1.38 rows=38 width=21) (actual time=0.007..0.165 rows=38 loops=4)

15. 2.784 18.696 ↑ 2.7 3 152

Materialize (cost=0.00..1,356.03 rows=8 width=16) (actual time=0.010..0.123 rows=3 loops=152)

16. 15.912 15.912 ↑ 2.7 3 4

Seq Scan on weekly_routine_careplan_answer wrca (cost=0.00..1,355.99 rows=8 width=16) (actual time=0.154..3.978 rows=3 loops=4)

  • Filter: (_wr.weekly_routine_id = weekly_routine_id)
  • Rows Removed by Filter: 68476
17. 0.136 2.288 ↑ 1.0 1 4

Aggregate (cost=160.09..160.10 rows=1 width=32) (actual time=0.567..0.572 rows=1 loops=4)

18. 2.152 2.152 ↑ 2.0 1 4

Seq Scan on weekly_routine_strategy wrs (cost=0.00..160.07 rows=2 width=4) (actual time=0.140..0.538 rows=1 loops=4)

  • Filter: (_wr.weekly_routine_id = weekly_routine_id)
  • Rows Removed by Filter: 7685
19. 0.112 1.868 ↑ 1.0 1 4

Aggregate (cost=217.28..217.29 rows=1 width=32) (actual time=0.461..0.467 rows=1 loops=4)

20. 0.072 1.756 ↓ 0.0 0 4

Nested Loop (cost=0.27..217.27 rows=1 width=8) (actual time=0.344..0.439 rows=0 loops=4)

21. 1.656 1.656 ↓ 0.0 0 4

Seq Scan on weekly_routine_asset wra (cost=0.00..208.95 rows=1 width=4) (actual time=0.328..0.414 rows=0 loops=4)

  • Filter: (_wr.weekly_routine_id = weekly_routine_id)
  • Rows Removed by Filter: 6956
22. 0.028 0.028 ↑ 1.0 1 2

Index Scan using routine_asset_pkey on routine_asset ra (cost=0.27..8.29 rows=1 width=8) (actual time=0.012..0.014 rows=1 loops=2)

  • Index Cond: (routine_asset_id = wra.routine_asset_id)