explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DTOX

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 0.292 ↓ 0.0 0 1

HashAggregate (cost=90.68..96.68 rows=400 width=400) (actual time=0.285..0.292 rows=0 loops=1)

  • Group Key: e1.event_id, events_index_tables.event_date
2.          

CTE events_index_tables

3. 0.016 0.228 ↓ 0.0 0 1

HashAggregate (cost=57.40..59.40 rows=200 width=8) (actual time=0.221..0.228 rows=0 loops=1)

  • Group Key: (unnest(events_colleague_repeating.event_ids)), events_colleague_repeating.event_date
4. 0.017 0.212 ↓ 0.0 0 1

HashAggregate (cost=52.40..54.40 rows=200 width=8) (actual time=0.204..0.212 rows=0 loops=1)

  • Group Key: (unnest(events_colleague_repeating.event_ids)), events_colleague_repeating.event_date
5. 0.016 0.195 ↓ 0.0 0 1

Append (cost=0.28..51.40 rows=200 width=8) (actual time=0.188..0.195 rows=0 loops=1)

6. 0.015 0.117 ↓ 0.0 0 1

ProjectSet (cost=0.28..8.55 rows=100 width=8) (actual time=0.110..0.117 rows=0 loops=1)

7. 0.102 0.102 ↓ 0.0 0 1

Index Scan using events_colleague_repeating_client_alias_id_date_idx on events_colleague_repeating (cost=0.28..8.05 rows=1 width=33) (actual time=0.095..0.102 rows=0 loops=1)

  • Index Cond: ((client_alias_id = 1) AND (event_date <= '2020-05-31'::date) AND (event_date >= '2020-05-24'::date))
8. 0.014 0.062 ↓ 0.0 0 1

ProjectSet (cost=4.29..39.85 rows=100 width=8) (actual time=0.055..0.062 rows=0 loops=1)

9. 0.015 0.048 ↓ 0.0 0 1

Nested Loop (cost=4.29..39.34 rows=1 width=36) (actual time=0.040..0.048 rows=0 loops=1)

10. 0.016 0.033 ↓ 0.0 0 1

Bitmap Heap Scan on events_team_repeating (cost=4.14..13.62 rows=6 width=40) (actual time=0.025..0.033 rows=0 loops=1)

  • Recheck Cond: ((event_date <= '2020-05-31'::date) AND (event_date >= '2020-05-24'::date) AND (team_id IS NOT NULL))
11. 0.017 0.017 ↓ 0.0 0 1

Bitmap Index Scan on events_team_repeating_team_id_date_idx (cost=0.00..4.13 rows=6 width=0) (actual time=0.009..0.017 rows=0 loops=1)

  • Index Cond: ((event_date <= '2020-05-31'::date) AND (event_date >= '2020-05-24'::date))
12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using teams_members_pkey on teams_members (cost=0.15..4.17 rows=1 width=4) (never executed)

  • Index Cond: ((team_id = events_team_repeating.team_id) AND (client_alias_id = 1))
  • Heap Fetches: 0
13. 0.015 0.275 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.27..27.04 rows=424 width=433) (actual time=0.267..0.275 rows=0 loops=1)

14. 0.016 0.260 ↓ 0.0 0 1

Hash Join (cost=1.07..5.61 rows=2 width=360) (actual time=0.252..0.260 rows=0 loops=1)

  • Hash Cond: (events_index_tables.event_id = e1.event_id)
15. 0.244 0.244 ↓ 0.0 0 1

CTE Scan on events_index_tables (cost=0.00..4.00 rows=200 width=8) (actual time=0.237..0.244 rows=0 loops=1)

16. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.05..1.05 rows=2 width=356) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on events e1 (cost=0.00..1.05 rows=2 width=356) (never executed)

  • Filter: (NOT deleted)
18. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on events_patients ep (cost=2.19..10.66 rows=5 width=77) (never executed)

  • Recheck Cond: (e1.event_id = event_id)
19. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on events_patients_pkey (cost=0.00..2.19 rows=5 width=0) (never executed)

  • Index Cond: (e1.event_id = event_id)
Planning time : 1.457 ms
Execution time : 0.811 ms