explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZgAQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.084 5.374 ↑ 5.0 1 1

Sort (cost=114.92..114.94 rows=5 width=17,877) (actual time=5.373..5.374 rows=1 loops=1)

  • Sort Key: issue.created_ts DESC
  • Sort Method: quicksort Memory: 25kB
2.          

CTE issue

3. 0.005 1.890 ↑ 5.0 1 1

Nested Loop Left Join (cost=9.72..23.32 rows=5 width=1,521) (actual time=1.882..1.890 rows=1 loops=1)

4. 0.008 1.884 ↑ 5.0 1 1

Nested Loop Left Join (cost=9.58..22.14 rows=5 width=1,494) (actual time=1.876..1.884 rows=1 loops=1)

5. 0.005 1.678 ↑ 5.0 1 1

Nested Loop Left Join (cost=9.44..20.58 rows=5 width=1,466) (actual time=1.671..1.678 rows=1 loops=1)

6. 0.006 1.120 ↑ 5.0 1 1

Nested Loop Left Join (cost=9.29..18.42 rows=5 width=1,406) (actual time=1.114..1.120 rows=1 loops=1)

7. 0.009 1.112 ↑ 5.0 1 1

Nested Loop Left Join (cost=9.15..16.00 rows=5 width=1,384) (actual time=1.107..1.112 rows=1 loops=1)

8. 0.044 0.359 ↑ 5.0 1 1

Hash Semi Join (cost=9.01..12.03 rows=5 width=940) (actual time=0.354..0.359 rows=1 loops=1)

  • Hash Cond: (issue_1.id = "ANY_subquery".id)
9. 0.057 0.057 ↑ 1.0 77 1

Seq Scan on issue issue_1 (cost=0.00..2.77 rows=77 width=940) (actual time=0.018..0.057 rows=77 loops=1)

10. 0.003 0.258 ↑ 5.0 1 1

Hash (cost=8.94..8.94 rows=5 width=8) (actual time=0.258..0.258 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.002 0.255 ↑ 5.0 1 1

Subquery Scan on ANY_subquery (cost=8.88..8.94 rows=5 width=8) (actual time=0.255..0.255 rows=1 loops=1)

12. 0.001 0.253 ↑ 5.0 1 1

Limit (cost=8.88..8.89 rows=5 width=16) (actual time=0.253..0.253 rows=1 loops=1)

13. 0.054 0.252 ↑ 5.0 1 1

Sort (cost=8.88..8.89 rows=5 width=16) (actual time=0.252..0.252 rows=1 loops=1)

  • Sort Key: issue_2.created_ts DESC
  • Sort Method: quicksort Memory: 25kB
14. 0.022 0.198 ↑ 5.0 1 1

Hash Semi Join (cost=5.76..8.82 rows=5 width=16) (actual time=0.197..0.198 rows=1 loops=1)

  • Hash Cond: (issue_2.id = isin.issue_id)
15. 0.033 0.033 ↑ 1.0 8 1

Seq Scan on issue issue_2 (cost=0.00..2.96 rows=8 width=16) (actual time=0.015..0.033 rows=8 loops=1)

  • Filter: (created_ts > '2019-01-01 00:00:00+02'::timestamp with time zone)
  • Rows Removed by Filter: 69
16. 0.009 0.143 ↑ 2.1 23 1

Hash (cost=5.15..5.15 rows=49 width=8) (actual time=0.143..0.143 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.048 0.134 ↑ 2.1 23 1

Hash Join (cost=2.48..5.15 rows=49 width=8) (actual time=0.104..0.134 rows=23 loops=1)

  • Hash Cond: (isin.interaction_id = inte_1.id)
18. 0.034 0.034 ↑ 1.0 86 1

Seq Scan on issue_interaction isin (cost=0.00..1.86 rows=86 width=16) (actual time=0.029..0.034 rows=86 loops=1)

19. 0.011 0.052 ↑ 1.5 25 1

Hash (cost=2.00..2.00 rows=38 width=8) (actual time=0.052..0.052 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.041 0.041 ↑ 1.5 25 1

Seq Scan on interaction inte_1 (cost=0.00..2.00 rows=38 width=8) (actual time=0.018..0.041 rows=25 loops=1)

  • Filter: ((created_by_person_id = 1) OR (behalf_of_person_id = 1))
  • Rows Removed by Filter: 42
21. 0.744 0.744 ↓ 0.0 0 1

Index Scan using issue_external_reference_issue_id_type_external_id_idx on issue_external_reference iser (cost=0.14..0.78 rows=1 width=452) (actual time=0.744..0.744 rows=0 loops=1)

  • Index Cond: (issue_id = issue_1.id)
22. 0.002 0.002 ↓ 0.0 0 1

Index Scan using person_pkey on person pers_next_inte (cost=0.14..0.47 rows=1 width=22) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (id = issue_1.next_interaction_person_id)
23. 0.553 0.553 ↑ 1.0 1 1

Index Scan using customer_pkey on customer cust (cost=0.14..0.42 rows=1 width=60) (actual time=0.553..0.553 rows=1 loops=1)

  • Index Cond: (id = issue_1.customer_id)
24. 0.198 0.198 ↑ 1.0 1 1

Index Scan using person_pkey on person pers_owner (cost=0.14..0.30 rows=1 width=36) (actual time=0.196..0.198 rows=1 loops=1)

  • Index Cond: (id = cust.owner_person_id)
25. 0.001 0.001 ↓ 0.0 0 1

Index Scan using legal_entity_pkey on legal_entity leen (cost=0.14..0.23 rows=1 width=35) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (id = cust.legal_entity_id)
26. 0.293 5.290 ↑ 5.0 1 1

Hash Left Join (cost=46.60..91.54 rows=5 width=17,877) (actual time=5.261..5.290 rows=1 loops=1)

  • Hash Cond: (issue.id = customer_product.issue_id)
27. 0.023 4.775 ↑ 5.0 1 1

Hash Left Join (cost=35.47..80.35 rows=5 width=17,835) (actual time=4.747..4.775 rows=1 loops=1)

  • Hash Cond: (issue.id = related_address.issue_id)
28. 0.023 4.297 ↑ 5.0 1 1

Hash Left Join (cost=24.80..69.60 rows=5 width=16,253) (actual time=4.269..4.297 rows=1 loops=1)

  • Hash Cond: (issue.id = catalog_service.issue_id)
29. 0.003 3.856 ↑ 5.0 1 1

Nested Loop Left Join (cost=13.22..57.96 rows=5 width=15,705) (actual time=3.828..3.856 rows=1 loops=1)

30. 0.006 3.852 ↑ 5.0 1 1

Nested Loop Left Join (cost=13.08..55.26 rows=5 width=15,189) (actual time=3.825..3.852 rows=1 loops=1)

31. 0.005 3.845 ↑ 5.0 1 1

Nested Loop Left Join (cost=12.94..52.57 rows=5 width=14,673) (actual time=3.818..3.845 rows=1 loops=1)

32. 0.074 3.632 ↑ 5.0 1 1

Hash Left Join (cost=12.79..49.87 rows=5 width=14,157) (actual time=3.606..3.632 rows=1 loops=1)

  • Hash Cond: (upper((issue.resolved_by)::text) = upper((resolver.username)::text))
33. 0.014 2.715 ↑ 5.0 1 1

Nested Loop Left Join (cost=1.45..38.44 rows=5 width=13,439) (actual time=2.690..2.715 rows=1 loops=1)

34. 0.007 2.700 ↑ 5.0 1 1

Nested Loop Left Join (cost=1.30..34.01 rows=5 width=12,721) (actual time=2.675..2.700 rows=1 loops=1)

35. 0.005 2.692 ↑ 5.0 1 1

Nested Loop Left Join (cost=1.16..31.35 rows=5 width=12,707) (actual time=2.668..2.692 rows=1 loops=1)

36. 0.002 2.467 ↑ 5.0 1 1

Nested Loop Left Join (cost=1.01..28.70 rows=5 width=12,693) (actual time=2.447..2.467 rows=1 loops=1)

37. 0.008 2.465 ↑ 5.0 1 1

Nested Loop Left Join (cost=0.88..24.29 rows=5 width=10,355) (actual time=2.445..2.465 rows=1 loops=1)

38. 0.006 2.456 ↑ 5.0 1 1

Nested Loop Left Join (cost=0.73..19.85 rows=5 width=10,347) (actual time=2.436..2.456 rows=1 loops=1)

39. 0.005 2.449 ↑ 5.0 1 1

Nested Loop Left Join (cost=0.59..15.41 rows=5 width=10,338) (actual time=2.429..2.449 rows=1 loops=1)

40. 0.003 2.011 ↑ 5.0 1 1

Nested Loop Left Join (cost=0.44..10.96 rows=5 width=10,320) (actual time=1.993..2.011 rows=1 loops=1)

41. 0.004 2.007 ↑ 5.0 1 1

Nested Loop Left Join (cost=0.30..6.54 rows=5 width=9,521) (actual time=1.990..2.007 rows=1 loops=1)

42. 0.066 2.003 ↑ 5.0 1 1

Hash Join (cost=0.16..2.13 rows=5 width=6,876) (actual time=1.986..2.003 rows=1 loops=1)

  • Hash Cond: (inte.id = issue.first_interaction_id)
43. 0.034 0.034 ↑ 1.0 67 1

Seq Scan on interaction inte (cost=0.00..1.67 rows=67 width=110) (actual time=0.025..0.034 rows=67 loops=1)

44. 0.006 1.903 ↑ 5.0 1 1

Hash (cost=0.10..0.10 rows=5 width=6,766) (actual time=1.903..1.903 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
45. 1.897 1.897 ↑ 5.0 1 1

CTE Scan on issue (cost=0.00..0.10 rows=5 width=6,766) (actual time=1.889..1.897 rows=1 loops=1)

46. 0.000 0.000 ↓ 0.0 0 1

Index Scan using email_interaction_pkey on email_interaction emin (cost=0.14..0.87 rows=1 width=2,653) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (id = inte.email_interaction_id)
47. 0.001 0.001 ↓ 0.0 0 1

Index Scan using sms_interaction_pkey on sms_interaction smin (cost=0.14..0.87 rows=1 width=807) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (id = inte.sms_interaction_id)
48. 0.433 0.433 ↑ 1.0 1 1

Index Scan using call_interaction_pkey on call_interaction cain (cost=0.14..0.88 rows=1 width=18) (actual time=0.432..0.433 rows=1 loops=1)

  • Index Cond: (id = inte.call_interaction_id)
49. 0.001 0.001 ↓ 0.0 0 1

Index Scan using direct_interaction_pkey on direct_interaction diin (cost=0.14..0.88 rows=1 width=9) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (id = inte.direct_interaction_id)
50. 0.001 0.001 ↓ 0.0 0 1

Index Only Scan using self_service_interaction_pkey on self_service_interaction sesi (cost=0.14..0.88 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (id = inte.self_service_interaction_id)
  • Heap Fetches: 0
51. 0.000 0.000 ↓ 0.0 0 1

Index Scan using letter_interaction_pkey on letter_interaction lein (cost=0.14..0.87 rows=1 width=2,354) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (id = inte.letter_interaction_id)
52. 0.220 0.220 ↑ 1.0 1 1

Index Scan using person_pkey on person pers_created_by (cost=0.14..0.52 rows=1 width=22) (actual time=0.217..0.220 rows=1 loops=1)

  • Index Cond: (id = inte.created_by_person_id)
53. 0.001 0.001 ↓ 0.0 0 1

Index Scan using person_pkey on person pers_behalf_of (cost=0.14..0.52 rows=1 width=22) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (id = inte.behalf_of_person_id)
54. 0.001 0.001 ↓ 0.0 0 1

Index Scan using employee_username_upper_idx on employee empl (cost=0.14..0.88 rows=1 width=718) (actual time=0.000..0.001 rows=0 loops=1)

  • Index Cond: (upper((username)::text) = upper((inte.created_by_username)::text))
55. 0.441 0.843 ↑ 2.7 22 1

Hash (cost=10.60..10.60 rows=60 width=718) (actual time=0.843..0.843 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
56. 0.402 0.402 ↑ 2.7 22 1

Seq Scan on employee resolver (cost=0.00..10.60 rows=60 width=718) (actual time=0.393..0.402 rows=22 loops=1)

57. 0.208 0.208 ↓ 0.0 0 1

Index Scan using issue_interaction_content_call_interaction_id_idx on issue_interaction_content isic_call (cost=0.14..0.53 rows=1 width=532) (actual time=0.208..0.208 rows=0 loops=1)

  • Index Cond: (cain.id = call_interaction_id)
58. 0.001 0.001 ↓ 0.0 0 1

Index Scan using issue_interaction_content_direct_interaction_id_idx on issue_interaction_content isic_direct (cost=0.14..0.53 rows=1 width=532) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (diin.id = direct_interaction_id)
59. 0.001 0.001 ↓ 0.0 0 1

Index Scan using issue_interaction_content_self_service_interaction_id_idx on issue_interaction_content isic_self_service (cost=0.14..0.53 rows=1 width=532) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (sesi.id = self_service_interaction_id)
60. 0.010 0.418 ↑ 35.0 2 1

Hash (cost=10.70..10.70 rows=70 width=556) (actual time=0.418..0.418 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
61. 0.408 0.408 ↑ 35.0 2 1

Seq Scan on catalog_service (cost=0.00..10.70 rows=70 width=556) (actual time=0.406..0.408 rows=2 loops=1)

62. 0.015 0.455 ↑ 30.0 1 1

Hash (cost=10.30..10.30 rows=30 width=1,590) (actual time=0.455..0.455 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
63. 0.440 0.440 ↑ 30.0 1 1

Seq Scan on related_address (cost=0.00..10.30 rows=30 width=1,590) (actual time=0.439..0.440 rows=1 loops=1)

64. 0.009 0.222 ↑ 25.0 2 1

Hash (cost=10.50..10.50 rows=50 width=838) (actual time=0.222..0.222 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
65. 0.213 0.213 ↑ 25.0 2 1

Seq Scan on customer_product (cost=0.00..10.50 rows=50 width=838) (actual time=0.212..0.213 rows=2 loops=1)