explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Fs

Settings

Optimization(s) for this plan:

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

Limit (cost=57,450.94..57,450.95 rows=20 width=1,310) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=57,450.94..57,451.31 rows=723 width=1,310) (actual rows= loops=)

  • Sort Key: ab.createdatetime DESC
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=15,020.98..57,447.10 rows=723 width=1,310) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=15,020.93..57,311.21 rows=723 width=1,001) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=282.37..29,776.76 rows=272 width=326) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=282.32..29,742.72 rows=272 width=246) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=272.08..26,956.05 rows=272 width=253) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Merge Join (cost=271.97..26,883.79 rows=272 width=240) (actual rows= loops=)

  • Merge Cond: (oc.outboundcampaignid = ab.outboundcampaignid)
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=271.92..26,857.07 rows=311 width=160) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=186.66..339.83 rows=311 width=176) (actual rows= loops=)

  • Join Filter: (oc.flowid = q.flowid)
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.16..134.77 rows=311 width=118) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using idx_outboundcampaign_1 on outboundcampaign oc (cost=0.05..52.16 rows=311 width=118) (actual rows= loops=)

  • Filter: (((bottype)::text = 'amplify'::text) AND (organizationid = '1f9292ae-5446-4b89-8e09-bf7c37f0d4c7'::uuid))
13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.11..0.26 rows=1 width=16) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.11..0.25 rows=1 width=32) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using idx_agent_1 on agent a (cost=0.05..0.12 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (oc.agentid = agentid)
16. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_account_1 on account acc (cost=0.05..0.13 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (accountid = a.accountid)
17. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.00 rows=1 width=24) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Materialize (cost=186.50..197.60 rows=6 width=74) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Subquery Scan on q (cost=186.50..197.60 rows=6 width=74) (actual rows= loops=)

  • Filter: (q._rownum = 1)
20. 0.000 0.000 ↓ 0.0

WindowAgg (cost=186.50..193.28 rows=1,233 width=2,932) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Sort (cost=186.50..187.12 rows=1,233 width=86) (actual rows= loops=)

  • Sort Key: f.flowid, fs.ordinal, fs.createdatetime
22. 0.000 0.000 ↓ 0.0

Hash Join (cost=93.80..173.84 rows=1,233 width=86) (actual rows= loops=)

  • Hash Cond: (ffp.flowid = f.flowid)
23. 0.000 0.000 ↓ 0.0

Hash Join (cost=57.28..132.70 rows=1,233 width=86) (actual rows= loops=)

  • Hash Cond: (fp.flowpageid = ffp.flowpageid)
24. 0.000 0.000 ↓ 0.0

Hash Join (cost=28.83..99.58 rows=1,296 width=102) (actual rows= loops=)

  • Hash Cond: (fs.flowpageid = fp.flowpageid)
25. 0.000 0.000 ↓ 0.0

Seq Scan on flowslot fs (cost=0.00..65.89 rows=1,296 width=86) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=24.62..24.62 rows=1,205 width=16) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on flowpage fp (cost=0.00..24.62 rows=1,205 width=16) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash (cost=24.44..24.44 rows=1,146 width=32) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Seq Scan on flowfirstpage ffp (cost=0.00..24.44 rows=1,146 width=32) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash (cost=32.47..32.47 rows=1,156 width=16) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on flow f (cost=0.00..32.47 rows=1,156 width=16) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Aggregate (cost=85.26..85.26 rows=1 width=16) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=40.55..85.25 rows=1 width=32) (actual rows= loops=)

  • Hash Cond: (_ar.applicantid = _a.applicantid)
  • Filter: ((_ar.flowslotid = q.flowslotid) OR (_ar.flowslotid IS NULL))
34. 0.000 0.000 ↓ 0.0

Seq Scan on applicantresponse _ar (cost=0.00..43.56 rows=1,520 width=48) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Hash (cost=40.47..40.47 rows=22 width=16) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on applicant _a (cost=2.09..40.47 rows=22 width=16) (actual rows= loops=)

  • Recheck Cond: (flowid = oc.flowid)
37. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_applicant_flow_cdt (cost=0.00..2.09 rows=22 width=0) (actual rows= loops=)

  • Index Cond: (flowid = oc.flowid)
38. 0.000 0.000 ↓ 0.0

Index Scan using idx_amplifybot_2 on amplifybot ab (cost=0.05..25.56 rows=380 width=80) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.11..0.26 rows=1 width=29) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.11..0.25 rows=1 width=45) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Index Scan using idx_agent_1 on agent a_1 (cost=0.05..0.12 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (oc.agentid = agentid)
42. 0.000 0.000 ↓ 0.0

Index Scan using idx_account_1 on account acc_1 (cost=0.05..0.13 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (accountid = a_1.accountid)
43. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.00 rows=1 width=24) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Limit (cost=10.24..10.24 rows=1 width=17) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Sort (cost=10.24..10.24 rows=1 width=17) (actual rows= loops=)

  • Sort Key: _atd.createdatetime DESC
46. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on asynctask _atd (cost=8.23..10.24 rows=1 width=17) (actual rows= loops=)

  • Recheck Cond: ((organizationid = oc.organizationid) AND ((handlername)::text = 'amplifyBotCampaignCreateAudienceAndStartAsyncTaskHandler'::text) AND ((metadata -> 'refType'::text) ? 'OutboundCampaign'::text))
  • Filter: ((metadata -> 'refKey'::text) ? (oc.outboundcampaignid)::text)
47. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=8.23..8.23 rows=1 width=0) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_asynctask_org_handler (cost=0.00..2.17 rows=59 width=0) (actual rows= loops=)

  • Index Cond: ((organizationid = oc.organizationid) AND ((handlername)::text = 'amplifyBotCampaignCreateAudienceAndStartAsyncTaskHandler'::text))
49. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_asynctask_wrapper2 (cost=0.00..6.01 rows=3 width=0) (actual rows= loops=)

  • Index Cond: ((metadata -> 'refType'::text) ? 'OutboundCampaign'::text)
50. 0.000 0.000 ↓ 0.0

Index Scan using pk_amplifybot on amplifybot amplifybot7_ (cost=0.05..0.12 rows=1 width=80) (actual rows= loops=)

  • Index Cond: (ab.amplifybotid = amplifybotid)
51. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=14,738.56..14,785.59 rows=3 width=675) (actual rows= loops=)

  • Hash Cond: (oc_2.outboundcampaignid = oc_1.outboundcampaignid)
52. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=3,309.70..3,355.09 rows=435 width=64) (actual rows= loops=)

  • Group Key: oc_2.outboundcampaignid
53. 0.000 0.000 ↓ 0.0

Sort (cost=3,309.70..3,313.09 rows=6,783 width=41) (actual rows= loops=)

  • Sort Key: oc_2.outboundcampaignid
54. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=346.21..3,223.37 rows=6,783 width=41) (actual rows= loops=)

  • Hash Cond: (aca.outboundcampaignid = oc_2.outboundcampaignid)
55. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=323.38..3,175.10 rows=6,783 width=41) (actual rows= loops=)

  • Hash Cond: ((md.messageid = am.messageid) AND (md.torefkey = aca.outboundcampaignapplicantid))
56. 0.000 0.000 ↓ 0.0

Seq Scan on messagedelivery md (cost=0.00..2,823.51 rows=18,807 width=41) (actual rows= loops=)

  • Filter: ((channeltype)::text = 'sms'::text)
57. 0.000 0.000 ↓ 0.0

Hash (cost=296.25..296.25 rows=6,783 width=64) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=182.09..296.25 rows=6,783 width=64) (actual rows= loops=)

  • Hash Cond: (am.applicantid = aca.applicantid)
59. 0.000 0.000 ↓ 0.0

Seq Scan on applicantmessage am (cost=0.00..104.01 rows=2,706 width=32) (actual rows= loops=)

  • Filter: ((direction)::text = 'out'::text)
60. 0.000 0.000 ↓ 0.0

Hash (cost=158.35..158.35 rows=6,783 width=48) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on outboundcampaignapplicant aca (cost=0.00..158.35 rows=6,783 width=48) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Hash (cost=21.30..21.30 rows=435 width=16) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Seq Scan on outboundcampaign oc_2 (cost=0.00..21.30 rows=435 width=16) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Hash (cost=11,428.85..11,428.85 rows=3 width=611) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=11,250.49..11,428.85 rows=3 width=611) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=11,165.23..11,173.05 rows=3 width=587) (actual rows= loops=)

  • Hash Cond: (f_1.flowid = oc_1.flowid)
67. 0.000 0.000 ↓ 0.0

HashAggregate (cost=886.35..889.82 rows=1,156 width=64) (actual rows= loops=)

  • Group Key: f_1.flowid
68. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=334.75..808.98 rows=14,068 width=56) (actual rows= loops=)

  • Hash Cond: (a_3.applicantid = ac.applicantid)
69. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=36.51..459.47 rows=14,068 width=40) (actual rows= loops=)

  • Hash Cond: (a_3.flowid = f_1.flowid)
70. 0.000 0.000 ↓ 0.0

Seq Scan on applicant a_3 (cost=0.00..370.20 rows=14,068 width=40) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Hash (cost=32.47..32.47 rows=1,156 width=16) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Seq Scan on flow f_1 (cost=0.00..32.47 rows=1,156 width=16) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

Hash (cost=250.72..250.72 rows=13,574 width=32) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Seq Scan on applicantcandidate ac (cost=0.00..250.72 rows=13,574 width=32) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Hash (cost=10,278.88..10,278.88 rows=1 width=539) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=10,267.77..10,278.88 rows=1 width=539) (actual rows= loops=)

  • Hash Cond: (q_1.flowid = oc_1.flowid)
77. 0.000 0.000 ↓ 0.0

Subquery Scan on q_1 (cost=10,267.33..10,278.43 rows=6 width=319) (actual rows= loops=)

  • Filter: (q_1._rownum = 1)
78. 0.000 0.000 ↓ 0.0

WindowAgg (cost=10,267.33..10,274.11 rows=1,233 width=3,113) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Sort (cost=10,267.33..10,267.95 rows=1,233 width=331) (actual rows= loops=)

  • Sort Key: f_2.flowid, fs_1.ordinal, fs_1.createdatetime
80. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=101.96..10,254.67 rows=1,233 width=331) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Hash Join (cost=93.80..173.84 rows=1,233 width=299) (actual rows= loops=)

  • Hash Cond: (ffp_1.flowid = f_2.flowid)
82. 0.000 0.000 ↓ 0.0

Hash Join (cost=57.28..132.70 rows=1,233 width=299) (actual rows= loops=)

  • Hash Cond: (fp_1.flowpageid = ffp_1.flowpageid)
83. 0.000 0.000 ↓ 0.0

Hash Join (cost=28.83..99.58 rows=1,296 width=315) (actual rows= loops=)

  • Hash Cond: (fs_1.flowpageid = fp_1.flowpageid)
84. 0.000 0.000 ↓ 0.0

Seq Scan on flowslot fs_1 (cost=0.00..65.89 rows=1,296 width=299) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Hash (cost=24.62..24.62 rows=1,205 width=16) (actual rows= loops=)

86. 0.000 0.000 ↓ 0.0

Seq Scan on flowpage fp_1 (cost=0.00..24.62 rows=1,205 width=16) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Hash (cost=24.44..24.44 rows=1,146 width=32) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Seq Scan on flowfirstpage ffp_1 (cost=0.00..24.44 rows=1,146 width=32) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Hash (cost=32.47..32.47 rows=1,156 width=16) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Seq Scan on flow f_2 (cost=0.00..32.47 rows=1,156 width=16) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.17..8.17 rows=1 width=32) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.13..8.17 rows=1 width=16) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.11..8.12 rows=1 width=32) (actual rows= loops=)

94. 0.000 0.000 ↓ 0.0

Index Scan using idx_flowslotbranch_2 on flowslotbranch fsb (cost=0.05..4.06 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (flowslotid = fs_1.flowslotid)
95. 0.000 0.000 ↓ 0.0

Index Scan using idx_flowslotbranchaction_2 on flowslotbranchaction fsba (cost=0.05..4.06 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (flowslotbranchid = fsb.flowslotbranchid)
96. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_flowaction_1 on flowaction fa (cost=0.03..0.04 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (flowactionid = fsba.flowactionid)
97. 0.000 0.000 ↓ 0.0

Hash (cost=0.44..0.44 rows=1 width=204) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.16..0.44 rows=1 width=204) (actual rows= loops=)

99. 0.000 0.000 ↓ 0.0

Index Scan using idx_outboundcampaign_1 on outboundcampaign oc_1 (cost=0.05..0.19 rows=1 width=191) (actual rows= loops=)

  • Index Cond: (ab.outboundcampaignid = outboundcampaignid)
100. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.11..0.24 rows=1 width=29) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.11..0.24 rows=1 width=45) (actual rows= loops=)

102. 0.000 0.000 ↓ 0.0

Index Scan using idx_agent_1 on agent a_2 (cost=0.05..0.10 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (oc_1.agentid = agentid)
103. 0.000 0.000 ↓ 0.0

Index Scan using idx_account_1 on account acc_2 (cost=0.05..0.13 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (accountid = a_2.accountid)
104. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.00 rows=1 width=24) (actual rows= loops=)

105. 0.000 0.000 ↓ 0.0

Aggregate (cost=85.26..85.26 rows=1 width=16) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=40.55..85.25 rows=1 width=32) (actual rows= loops=)

  • Hash Cond: (_ar_1.applicantid = _a_1.applicantid)
  • Filter: ((_ar_1.flowslotid = q_1.flowslotid) OR (_ar_1.flowslotid IS NULL))
107. 0.000 0.000 ↓ 0.0

Seq Scan on applicantresponse _ar_1 (cost=0.00..43.56 rows=1,520 width=48) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

Hash (cost=40.47..40.47 rows=22 width=16) (actual rows= loops=)

109. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on applicant _a_1 (cost=2.09..40.47 rows=22 width=16) (actual rows= loops=)

  • Recheck Cond: (flowid = oc_1.flowid)
110. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_applicant_flow_cdt (cost=0.00..2.09 rows=22 width=0) (actual rows= loops=)

  • Index Cond: (flowid = oc_1.flowid)
111. 0.000 0.000 ↓ 0.0

Index Scan using idx_outboundcampaign_1 on outboundcampaign outboundca2_ (cost=0.05..0.17 rows=1 width=191) (actual rows= loops=)

  • Index Cond: (oc_1.outboundcampaignid = outboundcampaignid)