explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sb55

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 0.060 ↓ 0.0 0 1

Sort (cost=1,426,957,216.24..1,426,957,947.50 rows=292,504 width=3,172) (actual time=0.060..0.060 rows=0 loops=1)

  • Sort Key: (age(audits.xmin)) DESC
  • Sort Method: quicksort Memory: 25kB
2.          

Initplan (for Sort)

3. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.00 rows=0 width=4) (never executed)

  • One-Time Filter: false
4. 0.000 0.051 ↓ 0.0 0 1

Nested Loop Left Join (cost=183.83..1,426,673,574.66 rows=292,504 width=3,172) (actual time=0.051..0.051 rows=0 loops=1)

5. 0.000 0.051 ↓ 0.0 0 1

Nested Loop Left Join (cost=183.54..1,426,574,118.91 rows=292,504 width=2,589) (actual time=0.051..0.051 rows=0 loops=1)

6. 0.001 0.051 ↓ 0.0 0 1

Nested Loop Left Join (cost=183.25..1,426,484,878.46 rows=292,504 width=2,575) (actual time=0.051..0.051 rows=0 loops=1)

  • Join Filter: ((audits.person_id = pr.recipient_id) OR (((ntfn.cat)::text = 'PERSON'::text) AND (recipient_ntfn.recipient_id = pr.recipient_id)) OR (((ntfn.cat)::text = 'LIVE'::text) AND (dvc.person_id = pr.recipient_id)))
7. 0.000 0.050 ↓ 0.0 0 1

Nested Loop Left Join (cost=94.23..630,125,624.96 rows=292,504 width=2,530) (actual time=0.050..0.050 rows=0 loops=1)

8. 0.000 0.050 ↓ 0.0 0 1

Nested Loop Left Join (cost=64.44..620,962,419.51 rows=292,504 width=2,530) (actual time=0.050..0.050 rows=0 loops=1)

9. 0.000 0.050 ↓ 0.0 0 1

Nested Loop Left Join (cost=64.30..620,916,385.91 rows=292,504 width=2,527) (actual time=0.050..0.050 rows=0 loops=1)

10. 0.001 0.050 ↓ 0.0 0 1

Nested Loop Left Join (cost=63.88..620,789,002.27 rows=292,504 width=2,466) (actual time=0.050..0.050 rows=0 loops=1)

11. 0.000 0.049 ↓ 0.0 0 1

Nested Loop Left Join (cost=63.47..620,655,506.60 rows=292,504 width=2,391) (actual time=0.049..0.049 rows=0 loops=1)

  • Join Filter: ((audits.dvc_id = dr.recipient_id) OR (((ntfn.cat)::text = 'DEVICE'::text) AND (recipient_ntfn.recipient_id = dr.recipient_id)))
12. 0.000 0.049 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.12..4,063,935.41 rows=292,504 width=2,338) (actual time=0.049..0.049 rows=0 loops=1)

13. 0.000 0.049 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.69..3,921,851.96 rows=292,504 width=2,330) (actual time=0.049..0.049 rows=0 loops=1)

  • Join Filter: (audits.parent_ntfn_id IS NULL)
14. 0.000 0.049 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.13..3,692,300.26 rows=292,504 width=2,270) (actual time=0.049..0.049 rows=0 loops=1)

15. 0.001 0.049 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.56..3,009,836.94 rows=292,504 width=2,202) (actual time=0.049..0.049 rows=0 loops=1)

16. 0.000 0.048 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.13..2,873,012.56 rows=292,504 width=2,194) (actual time=0.048..0.048 rows=0 loops=1)

17. 0.000 0.048 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.70..2,730,929.11 rows=292,504 width=2,186) (actual time=0.048..0.048 rows=0 loops=1)

18. 0.001 0.048 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.14..2,048,465.79 rows=292,504 width=2,116) (actual time=0.048..0.048 rows=0 loops=1)

19. 0.047 0.047 ↓ 0.0 0 1

Index Scan using idx_audit_evs_all_when_created on audit_evs_all audits (cost=0.57..1,366,002.47 rows=292,504 width=1,998) (actual time=0.047..0.047 rows=0 loops=1)

  • Index Cond: (when_created >= (now() - '00:05:00'::interval))
  • Filter: (((audit_ev_discriminator)::text = 'AUDIT_NTFN_EVS'::text) AND (age(xmin) < COALESCE(($0)::bigint, '9223372036854775807'::bigint)))
20. 0.000 0.000 ↓ 0.0 0

Index Scan using ntfn_pk on ntfn (cost=0.56..2.33 rows=1 width=126) (never executed)

  • Index Cond: (ntfn_id = audits.ntfn_id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using ntfn_pk on ntfn rn (cost=0.56..2.33 rows=1 width=78) (never executed)

  • Index Cond: (ntfn_id = audits.root_ntfn_id)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using recipient_ntfn_pk on recipient_ntfn (cost=0.43..0.49 rows=1 width=16) (never executed)

  • Index Cond: (ntfn_id = ntfn.ntfn_id)
23. 0.000 0.000 ↓ 0.0 0

Index Scan using live_ntfn_pk on live_ntfn (cost=0.43..0.47 rows=1 width=16) (never executed)

  • Index Cond: (ntfn_id = ntfn.ntfn_id)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using ntfn_pk on ntfn pn1 (cost=0.56..2.33 rows=1 width=68) (never executed)

  • Index Cond: (ntfn_id = audits.parent_ntfn_id)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using ntfn_pk on ntfn pn2 (cost=0.56..0.77 rows=1 width=68) (never executed)

  • Index Cond: (ntfn_id = live_ntfn.dvc_ntfn_id)
26. 0.000 0.000 ↓ 0.0 0

Index Scan using recipient_ntfn_pk on recipient_ntfn prn (cost=0.43..0.49 rows=1 width=16) (never executed)

  • Index Cond: (ntfn_id = COALESCE(pn1.ntfn_id, pn2.ntfn_id))
27. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on recipients dr (cost=59.34..60.86 rows=116,978 width=53) (never executed)

  • Recheck Cond: ((audits.dvc_id = recipient_id) OR (recipient_ntfn.recipient_id = recipient_id))
28. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=59.34..59.34 rows=2 width=0) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on recipients_pk (cost=0.00..0.43 rows=1 width=0) (never executed)

  • Index Cond: (recipient_id = audits.dvc_id)
30. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on recipients_pk (cost=0.00..0.43 rows=1 width=0) (never executed)

  • Index Cond: (recipient_id = recipient_ntfn.recipient_id)
31. 0.000 0.000 ↓ 0.0 0

Index Scan using recipients_pk on recipients rr (cost=0.42..0.46 rows=1 width=83) (never executed)

  • Index Cond: (recipient_id = audits.recipient_id)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using recipients_pk on recipients parentr (cost=0.42..0.44 rows=1 width=77) (never executed)

  • Index Cond: (recipient_id = prn.recipient_id)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using org_dvc_names_pk on org_dvc_names odn (cost=0.14..0.16 rows=1 width=19) (never executed)

  • Index Cond: (org_dvc_name_id = dr.org_dvc_name_id)
34. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on dvc (cost=29.79..31.32 rows=1 width=16) (never executed)

  • Recheck Cond: ((dr.recipient_id = dvc_id) OR (audits.dvc_id = dvc_id))
  • Filter: ((dr.recipient_id = dvc_id) OR ((dr.recipient_id IS NULL) AND (audits.dvc_id = dvc_id)))
35. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=29.79..29.79 rows=2 width=0) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on dvc_pk (cost=0.00..0.30 rows=1 width=0) (never executed)

  • Index Cond: (dvc_id = dr.recipient_id)
37. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on dvc_pk (cost=0.00..0.30 rows=1 width=0) (never executed)

  • Index Cond: (dvc_id = audits.dvc_id)
38. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on recipients pr (cost=89.02..90.55 rows=116,978 width=59) (never executed)

  • Recheck Cond: ((audits.person_id = recipient_id) OR (recipient_ntfn.recipient_id = recipient_id) OR (dvc.person_id = recipient_id))
39. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=89.02..89.02 rows=3 width=0) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on recipients_pk (cost=0.00..0.43 rows=1 width=0) (never executed)

  • Index Cond: (recipient_id = audits.person_id)
41. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on recipients_pk (cost=0.00..0.43 rows=1 width=0) (never executed)

  • Index Cond: (recipient_id = recipient_ntfn.recipient_id)
42. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on recipients_pk (cost=0.00..0.44 rows=1 width=0) (never executed)

  • Index Cond: (recipient_id = dvc.person_id)
43. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pk on persons p1 (cost=0.29..0.31 rows=1 width=22) (never executed)

  • Index Cond: (person_id = recipient_ntfn.recipient_id)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pk on persons p2 (cost=0.29..0.33 rows=1 width=22) (never executed)

  • Index Cond: (person_id = dvc.person_id)
Planning time : 3,604.404 ms
Execution time : 0.589 ms