explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4P7A

Settings
# exclusive inclusive rows x rows loops node
1. 1.042 3.635 ↑ 5.0 1 1

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

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

CTE issue

3. 0.005 1.308 ↑ 5.0 1 1

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

4. 0.005 1.302 ↑ 5.0 1 1

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

5. 0.005 1.282 ↑ 5.0 1 1

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

6. 0.002 1.256 ↑ 5.0 1 1

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

7. 0.008 1.253 ↑ 5.0 1 1

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

8. 0.170 1.228 ↑ 5.0 1 1

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

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

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

10. 0.025 0.920 ↑ 5.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.007 0.895 ↑ 5.0 1 1

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

12. 0.006 0.888 ↑ 5.0 1 1

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

13. 0.094 0.882 ↑ 5.0 1 1

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

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

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

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

Seq Scan on issue issue_2 (cost=0.00..2.96 rows=8 width=16) (actual time=0.097..0.272 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.020 0.344 ↑ 2.1 23 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.116 0.324 ↑ 2.1 23 1

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

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

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

19. 0.030 0.151 ↑ 1.5 25 1

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

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

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

  • Filter: ((created_by_person_id = 1) OR (behalf_of_person_id = 1))
  • Rows Removed by Filter: 42
21. 0.017 0.017 ↓ 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.017..0.017 rows=0 loops=1)

  • Index Cond: (issue_id = issue_1.id)
22. 0.001 0.001 ↓ 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.001..0.001 rows=0 loops=1)

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

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

  • Index Cond: (id = issue_1.customer_id)
24. 0.015 0.015 ↑ 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.015..0.015 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.032 2.593 ↑ 5.0 1 1

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

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

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

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

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

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

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

30. 0.003 2.420 ↑ 5.0 1 1

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

31. 0.005 2.416 ↑ 5.0 1 1

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

32. 0.104 2.399 ↑ 5.0 1 1

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

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

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

34. 0.006 2.091 ↑ 5.0 1 1

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

35. 0.008 2.084 ↑ 5.0 1 1

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

36. 0.007 2.044 ↑ 5.0 1 1

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

37. 0.026 2.036 ↑ 5.0 1 1

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

38. 0.009 2.008 ↑ 5.0 1 1

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

39. 0.006 1.998 ↑ 5.0 1 1

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

40. 0.004 1.952 ↑ 5.0 1 1

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

41. 0.003 1.947 ↑ 5.0 1 1

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

42. 0.462 1.943 ↑ 5.0 1 1

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

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

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

44. 0.011 1.341 ↑ 5.0 1 1

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

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

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

46. 0.001 0.001 ↓ 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.001..0.001 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.040 0.040 ↑ 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.036..0.040 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.002 0.002 ↓ 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.002..0.002 rows=0 loops=1)

  • Index Cond: (id = inte.self_service_interaction_id)
  • Heap Fetches: 0
51. 0.001 0.001 ↓ 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.001..0.001 rows=0 loops=1)

  • Index Cond: (id = inte.letter_interaction_id)
52. 0.032 0.032 ↑ 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.030..0.032 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.002 0.002 ↓ 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.002..0.002 rows=0 loops=1)

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

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

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

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

57. 0.012 0.012 ↓ 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.012..0.012 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.006 0.024 ↑ 35.0 2 1

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

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

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

62. 0.007 0.021 ↑ 30.0 1 1

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

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

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

64. 0.009 0.038 ↑ 25.0 2 1

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

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

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