explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C5VHD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=889,269.72..4,915,996.88 rows=6,779,229 width=8) (actual rows= loops=)

  • Merge Cond: (u.id = ns.emp_id)
  • Join Filter: (ns.shift_time_template_id = stt.id)
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=889,269.16..1,411,268.33 rows=6,897,974 width=12) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Merge Join (cost=889,268.73..991,625.13 rows=239,427 width=12) (actual rows= loops=)

  • Merge Cond: (u.id = notification_shift.emp_id)
4. 0.000 0.000 ↓ 0.0

Index Scan using idx_tg_user_id_v2org_id on tg_user u (cost=0.43..90,552.74 rows=3,285,074 width=12) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=889,268.30..889,866.87 rows=239,427 width=4) (actual rows= loops=)

  • Sort Key: notification_shift.emp_id
6. 0.000 0.000 ↓ 0.0

HashAggregate (cost=863,087.89..865,482.16 rows=239,427 width=4) (actual rows= loops=)

  • Group Key: notification_shift.emp_id
7. 0.000 0.000 ↓ 0.0

Seq Scan on notification_shift (cost=0.00..697,649.45 rows=66,175,375 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using unique_shift_time_template_org_home_loc_id on shift_time_template stt (cost=0.42..1.47 rows=28 width=8) (actual rows= loops=)

  • Index Cond: (v2organization_id = u.v2organization_id)
  • Filter: (home_v2organization_id IS NULL)
9. 0.000 0.000 ↓ 0.0

Materialize (cost=0.56..1,221,217.23 rows=66,175,375 width=8) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using ns_emp_id_idx on notification_shift ns (cost=0.56..1,055,778.79 rows=66,175,375 width=8) (actual rows= loops=)