explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g9WH

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

Limit (cost=142,431.90..142,431.90 rows=1 width=20) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=142,431.90..142,474.99 rows=17,234 width=20) (actual rows= loops=)

  • Sort Key: rpnto.last_resp_received DESC
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=55,421.50..142,345.73 rows=17,234 width=20) (actual rows= loops=)

  • Hash Cond: (rpnt.ntfn_id = nt.ntfn_id)
  • Join Filter: (((rpnt.ntfn_id = '317617624'::bigint) OR (alternatives: SubPlan 3 or hashed SubPlan 4) OR ((alternatives: SubPlan 5 or hashed SubPlan 6) AND ((nt.cat)::text = 'PERSON'::text))) AND ((rpnt.last_resp_value IS NOT NULL) OR (alternatives: SubPlan 1 or hashed SubPlan 2)))
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=28,211.18..90,313.26 rows=9,456,057 width=56) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Gather (cost=28,210.74..64,676.11 rows=3,924 width=36) (actual rows= loops=)

  • Workers Planned: 4
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=27,210.74..63,283.71 rows=981 width=36) (actual rows= loops=)

  • Hash Cond: (rpnto.ntfn_id = nto.ntfn_id)
7. 0.000 0.000 ↓ 0.0

Parallel Index Scan Backward using recipient_ntfn_ntfn_id_lrr_not_null_pidx on recipient_ntfn rpnto (cost=0.42..35,634.45 rows=167,218 width=36) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=25,193.17..25,193.17 rows=161,372 width=16) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using idx_ntfn1 on ntfn nto (cost=0.56..25,193.17 rows=161,372 width=16) (actual rows= loops=)

  • Index Cond: (ev_id = '78572093'::bigint)
10. 0.000 0.000 ↓ 0.0

Index Scan using idx_recipient_ntfn5 on recipient_ntfn rpnt (cost=0.44..4.78 rows=175 width=28) (actual rows= loops=)

  • Index Cond: (recipient_id = rpnto.recipient_id)
11. 0.000 0.000 ↓ 0.0

Hash (cost=25,193.17..25,193.17 rows=161,372 width=22) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using idx_ntfn1 on ntfn nt (cost=0.56..25,193.17 rows=161,372 width=22) (actual rows= loops=)

  • Index Cond: (ev_id = '78572093'::bigint)
13.          

SubPlan (for Hash Join)

14. 0.000 0.000 ↓ 0.0

Result (cost=0.56..3.58 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: ((nt.cat)::text = 'PERSON'::text)
15. 0.000 0.000 ↓ 0.0

Index Scan using recipient_ntfn_pk on recipient_ntfn rpnt3 (cost=0.56..3.58 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (ntfn_id = '317617624'::bigint)
  • Filter: (parent_ntfn_id = rpnt.ntfn_id)
16. 0.000 0.000 ↓ 0.0

Index Scan using recipient_ntfn_pk on recipient_ntfn rpnt3_1 (cost=0.56..3.58 rows=1 width=40) (actual rows= loops=)

  • Index Cond: (ntfn_id = '317617624'::bigint)
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.99..7.04 rows=1 width=0) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using live_ntfn_pk on live_ntfn lvnt (cost=0.43..3.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ntfn_id = '317617624'::bigint)
19. 0.000 0.000 ↓ 0.0

Index Scan using recipient_ntfn_pk on recipient_ntfn rpnt4 (cost=0.56..3.58 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ntfn_id = lvnt.dvc_ntfn_id)
  • Filter: (parent_ntfn_id = rpnt.ntfn_id)
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.99..7.03 rows=1 width=8) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using live_ntfn_pk on live_ntfn lvnt_1 (cost=0.43..3.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ntfn_id = '317617624'::bigint)
22. 0.000 0.000 ↓ 0.0

Index Scan using recipient_ntfn_pk on recipient_ntfn rpnt4_1 (cost=0.56..3.58 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (ntfn_id = lvnt_1.dvc_ntfn_id)
23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.99..32.11 rows=1 width=0) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using recipient_ntfn_recipient_id_lrr_not_null_pidx on recipient_ntfn rpnt2 (cost=0.42..10.61 rows=6 width=8) (actual rows= loops=)

  • Index Cond: (recipient_id = rpnt.recipient_id)
25. 0.000 0.000 ↓ 0.0

Index Scan using ntfn_pk on ntfn nt2 (cost=0.56..3.58 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ntfn_id = rpnt2.ntfn_id)
  • Filter: (ev_id = nt.ev_id)
26. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.99..435,300.96 rows=668,873 width=16) (actual rows= loops=)

  • Workers Planned: 4
27. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.99..367,413.66 rows=167,218 width=16) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Parallel Index Scan Backward using recipient_ntfn_ntfn_id_lrr_not_null_pidx on recipient_ntfn rpnt2_1 (cost=0.42..35,634.45 rows=167,218 width=16) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Index Scan using ntfn_pk on ntfn nt2_1 (cost=0.56..1.98 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (ntfn_id = rpnt2_1.ntfn_id)