explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xplb

Settings
# exclusive inclusive rows x rows loops node
1. 0.045 1,374.252 ↓ 0.0 0 1

Sort (cost=339,440.13..339,440.16 rows=11 width=9,457) (actual time=1,374.251..1,374.252 rows=0 loops=1)

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

CTE issue

3. 0.002 1,374.138 ↓ 0.0 0 1

Nested Loop Left Join (cost=338,914.88..339,021.96 rows=10 width=2,322) (actual time=1,374.138..1,374.138 rows=0 loops=1)

4. 0.000 1,374.136 ↓ 0.0 0 1

Nested Loop Left Join (cost=338,914.46..339,017.27 rows=10 width=2,292) (actual time=1,374.136..1,374.136 rows=0 loops=1)

5. 0.000 1,374.136 ↓ 0.0 0 1

Nested Loop Left Join (cost=338,914.04..339,011.66 rows=10 width=2,265) (actual time=1,374.136..1,374.136 rows=0 loops=1)

6. 0.002 1,374.137 ↓ 0.0 0 1

Nested Loop Left Join (cost=338,913.61..339,006.59 rows=10 width=2,205) (actual time=1,374.136..1,374.137 rows=0 loops=1)

7. 0.001 1,374.135 ↓ 0.0 0 1

Nested Loop Left Join (cost=338,913.18..339,001.72 rows=10 width=2,184) (actual time=1,374.135..1,374.135 rows=0 loops=1)

8. 0.001 1,374.134 ↓ 0.0 0 1

Nested Loop (cost=338,912.76..338,997.00 rows=10 width=2,128) (actual time=1,374.134..1,374.134 rows=0 loops=1)

9. 0.002 1,374.133 ↓ 0.0 0 1

HashAggregate (cost=338,912.33..338,912.43 rows=10 width=8) (actual time=1,374.133..1,374.133 rows=0 loops=1)

  • Group Key: issue_2.id
10. 0.000 1,374.131 ↓ 0.0 0 1

Limit (cost=338,912.18..338,912.20 rows=10 width=16) (actual time=1,374.131..1,374.131 rows=0 loops=1)

11. 0.019 1,374.131 ↓ 0.0 0 1

Sort (cost=338,912.18..338,912.21 rows=14 width=16) (actual time=1,374.131..1,374.131 rows=0 loops=1)

  • Sort Key: issue_2.created_ts DESC
  • Sort Method: quicksort Memory: 25kB
12. 0.002 1,374.112 ↓ 0.0 0 1

Nested Loop (cost=338,873.52..338,911.91 rows=14 width=16) (actual time=1,374.111..1,374.112 rows=0 loops=1)

13. 0.002 1,374.110 ↓ 0.0 0 1

HashAggregate (cost=338,873.09..338,873.75 rows=66 width=8) (actual time=1,374.110..1,374.110 rows=0 loops=1)

  • Group Key: isin.issue_id
14. 0.029 1,374.108 ↓ 0.0 0 1

Hash Join (cost=160,385.11..338,872.92 rows=66 width=8) (actual time=1,374.108..1,374.108 rows=0 loops=1)

  • Hash Cond: (isin.interaction_id = inte_1.id)
15. 0.032 0.032 ↑ 5,522,266.0 1 1

Seq Scan on issue_interaction isin (cost=0.00..157,778.66 rows=5,522,266 width=16) (actual time=0.032..0.032 rows=1 loops=1)

16. 0.002 1,374.047 ↓ 0.0 0 1

Hash (cost=160,384.63..160,384.63 rows=38 width=8) (actual time=1,374.047..1,374.047 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
17. 1,374.045 1,374.045 ↓ 0.0 0 1

Seq Scan on interaction inte_1 (cost=0.00..160,384.63 rows=38 width=8) (actual time=1,374.045..1,374.045 rows=0 loops=1)

  • Filter: ((created_by_person_id = 1) OR (behalf_of_person_id = 1))
  • Rows Removed by Filter: 3175187
18. 0.000 0.000 ↓ 0.0 0

Index Scan using issue_pkey on issue issue_2 (cost=0.43..0.57 rows=1 width=16) (never executed)

  • Index Cond: (id = isin.issue_id)
  • Filter: (created_ts > '2019-01-01 00:00:00+02'::timestamp with time zone)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using issue_pkey on issue issue_1 (cost=0.43..8.45 rows=1 width=2,128) (never executed)

  • Index Cond: (id = issue_2.id)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using issue_external_reference_issue_id_type_external_id_idx on issue_external_reference iser (cost=0.42..0.46 rows=1 width=64) (never executed)

  • Index Cond: (issue_id = issue_1.id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using person_pkey on person pers_next_inte (cost=0.43..0.48 rows=1 width=21) (never executed)

  • Index Cond: (id = issue_1.next_interaction_person_id)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using customer_pkey on customer cust (cost=0.43..0.50 rows=1 width=60) (never executed)

  • Index Cond: (id = issue_1.customer_id)
23. 0.000 0.000 ↓ 0.0 0

Index Scan using person_pkey on person pers_owner (cost=0.43..0.55 rows=1 width=35) (never executed)

  • Index Cond: (id = cust.owner_person_id)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using legal_entity_pkey on legal_entity leen (cost=0.42..0.46 rows=1 width=38) (never executed)

  • Index Cond: (id = cust.legal_entity_id)
25. 0.000 1,374.207 ↓ 0.0 0 1

Hash Left Join (cost=156.95..417.99 rows=11 width=9,457) (actual time=1,374.207..1,374.207 rows=0 loops=1)

  • Hash Cond: (issue.id = customer_product.issue_id)
26. 0.001 1,374.207 ↓ 0.0 0 1

Hash Left Join (cost=143.41..404.30 rows=11 width=8,996) (actual time=1,374.207..1,374.207 rows=0 loops=1)

  • Hash Cond: (issue.id = related_address.issue_id)
27. 0.001 1,374.206 ↓ 0.0 0 1

Hash Left Join (cost=138.70..399.44 rows=11 width=8,901) (actual time=1,374.206..1,374.206 rows=0 loops=1)

  • Hash Cond: (issue.id = catalog_service.issue_id)
28. 0.000 1,374.205 ↓ 0.0 0 1

Nested Loop Left Join (cost=134.41..394.99 rows=11 width=8,876) (actual time=1,374.205..1,374.205 rows=0 loops=1)

29. 0.001 1,374.205 ↓ 0.0 0 1

Nested Loop Left Join (cost=133.98..381.26 rows=10 width=8,852) (actual time=1,374.205..1,374.205 rows=0 loops=1)

30. 0.001 1,374.204 ↓ 0.0 0 1

Nested Loop Left Join (cost=133.55..298.88 rows=10 width=8,828) (actual time=1,374.204..1,374.204 rows=0 loops=1)

31. 0.000 1,374.203 ↓ 0.0 0 1

Nested Loop Left Join (cost=133.26..219.73 rows=10 width=8,799) (actual time=1,374.203..1,374.203 rows=0 loops=1)

32. 0.001 1,374.203 ↓ 0.0 0 1

Nested Loop Left Join (cost=132.97..211.57 rows=10 width=8,770) (actual time=1,374.203..1,374.203 rows=0 loops=1)

33. 0.000 1,374.202 ↓ 0.0 0 1

Nested Loop Left Join (cost=132.55..200.49 rows=10 width=8,757) (actual time=1,374.202..1,374.202 rows=0 loops=1)

34. 0.016 1,374.202 ↓ 0.0 0 1

Merge Right Join (cost=132.12..189.41 rows=10 width=8,744) (actual time=1,374.202..1,374.202 rows=0 loops=1)

  • Merge Cond: (isic_call.call_interaction_id = cain.id)
  • -> Index Scan using issue_interaction_content_call_interaction_id_idx on issue_interaction_content isic_call (cost=0.43..184280.85 rows=2681228 width=40) (actual time=0.012..0.013 rows=1 loo
35. 0.043 1,374.186 ↓ 0.0 0 1

Sort (cost=131.69..131.71 rows=10 width=8,720) (actual time=1,374.186..1,374.186 rows=0 loops=1)

  • Sort Key: cain.id
  • Sort Method: quicksort Memory: 25kB
36. 0.001 1,374.143 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.54..131.52 rows=10 width=8,720) (actual time=1,374.143..1,374.143 rows=0 loops=1)

37. 0.000 1,374.142 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.26..125.69 rows=10 width=8,612) (actual time=1,374.142..1,374.142 rows=0 loops=1)

38. 0.000 1,374.142 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.83..115.14 rows=10 width=8,604) (actual time=1,374.142..1,374.142 rows=0 loops=1)

39. 0.000 1,374.142 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.56..112.12 rows=10 width=8,595) (actual time=1,374.142..1,374.142 rows=0 loops=1)

40. 0.002 1,374.142 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.28..107.47 rows=10 width=8,577) (actual time=1,374.141..1,374.142 rows=0 loops=1)

41. 0.000 1,374.140 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.85..96.35 rows=10 width=8,138) (actual time=1,374.140..1,374.140 rows=0 loops=1)

42. 0.001 1,374.140 ↓ 0.0 0 1

Nested Loop (cost=0.43..84.78 rows=10 width=6,876) (actual time=1,374.140..1,374.140 rows=0 loops=1)

43. 1,374.139 1,374.139 ↓ 0.0 0 1

CTE Scan on issue (cost=0.00..0.20 rows=10 width=6,766) (actual time=1,374.139..1,374.139 rows=0 loops=1)

44. 0.000 0.000 ↓ 0.0 0

Index Scan using interaction_pkey on interaction inte (cost=0.43..8.45 rows=1 width=110) (never executed)

  • Index Cond: (id = issue.first_interaction_id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using email_interaction_pkey on email_interaction emin (cost=0.42..1.15 rows=1 width=1,270) (never executed)

  • Index Cond: (id = inte.email_interaction_id)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using sms_interaction_pkey on sms_interaction smin (cost=0.42..1.10 rows=1 width=447) (never executed)

  • Index Cond: (id = inte.sms_interaction_id)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using call_interaction_pkey on call_interaction cain (cost=0.28..0.46 rows=1 width=18) (never executed)

  • Index Cond: (id = inte.call_interaction_id)
48. 0.000 0.000 ↓ 0.0 0

Index Scan using direct_interaction_pkey on direct_interaction diin (cost=0.28..0.29 rows=1 width=9) (never executed)

  • Index Cond: (id = inte.direct_interaction_id)
49. 0.000 0.000 ↓ 0.0 0

Index Only Scan using self_service_interaction_pkey on self_service_interaction sesi (cost=0.43..1.05 rows=1 width=8) (never executed)

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

Index Scan using letter_interaction_pkey on letter_interaction lein (cost=0.28..0.57 rows=1 width=124) (never executed)

  • Index Cond: (id = inte.letter_interaction_id)
51. 0.000 0.000 ↓ 0.0 0

Index Scan using person_pkey on person pers_created_by (cost=0.43..1.10 rows=1 width=21) (never executed)

  • Index Cond: (id = inte.created_by_person_id)
52. 0.000 0.000 ↓ 0.0 0

Index Scan using person_pkey on person pers_behalf_of (cost=0.43..1.10 rows=1 width=21) (never executed)

  • Index Cond: (id = inte.behalf_of_person_id)
53. 0.000 0.000 ↓ 0.0 0

Index Scan using employee_username_upper_idx on employee empl (cost=0.29..0.81 rows=1 width=29) (never executed)

  • Index Cond: (upper((username)::text) = upper((inte.created_by_username)::text))
54. 0.000 0.000 ↓ 0.0 0

Index Scan using employee_username_upper_idx on employee resolver (cost=0.29..7.90 rows=1 width=29) (never executed)

  • Index Cond: (upper((username)::text) = upper((issue.resolved_by)::text))
55. 0.000 0.000 ↓ 0.0 0

Index Scan using issue_interaction_content_direct_interaction_id_idx on issue_interaction_content isic_direct (cost=0.43..8.23 rows=1 width=40) (never executed)

  • Index Cond: (diin.id = direct_interaction_id)
56. 0.000 0.000 ↓ 0.0 0

Index Scan using issue_interaction_content_self_service_interaction_id_idx on issue_interaction_content isic_self_service (cost=0.43..1.33 rows=4 width=40) (never executed)

  • Index Cond: (sesi.id = self_service_interaction_id)
57. 0.000 0.000 ↓ 0.0 0

Hash (cost=3.02..3.02 rows=102 width=33) (never executed)

58. 0.000 0.000 ↓ 0.0 0

Seq Scan on catalog_service (cost=0.00..3.02 rows=102 width=33) (never executed)

59. 0.000 0.000 ↓ 0.0 0

Hash (cost=3.76..3.76 rows=76 width=103) (never executed)

60. 0.000 0.000 ↓ 0.0 0

Seq Scan on related_address (cost=0.00..3.76 rows=76 width=103) (never executed)

61. 0.000 0.000 ↓ 0.0 0

Hash (cost=9.35..9.35 rows=335 width=48) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Seq Scan on customer_product (cost=0.00..9.35 rows=335 width=48) (never executed)